Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

CSS positioning div wrapping
 

DKode




quote this post edit post

IP Loged report this post

Old Post  06-16-04 - 12:16 AM  
Ok,

I signed up for a blogger.com account today and when I went to edit
the template design I noticed it is written in pure CSS. At the sight
of this I danced for joy, as I am currently writing a dotnet asp
application that will use css positioning for the content.

I picked apart all of the templates at blogger.com and understand what
they were doing with all of the CSS code. There was only one part that
I did not quite understand...

In most of the templates they were double wrapping tags for any
content areas. example:

css:

#sidebar {
background:#cdb url("http://www.blogblog.com/no897/corner_sidebar.gif")
no-repeat left top;
width:254px;
float:right;
padding:0;
color:#356;
}
#sidebar2 {
margin:0;
padding:2px 20px 10px;
}

Then in the html they have:

<!-- Begin #sidebar -->
<div id="sidebar"><div id="sidebar2">

Same with #main & #main2.

Why are they putting half of the tag in one div and the other half in
another and in the html they always appear one right after the other?
Couldn't they just combine both css into one id and then that would
eliminate the second "wrapped" css id?


Post Follow-Up to this message ]
Re: CSS positioning div wrapping
 

Steve Pugh




quote this post edit post

IP Loged report this post

Old Post  06-16-04 - 12:16 AM  
dkode@cfl.rr.com (DKode) wrote:

>I picked apart all of the templates at blogger.com and understand what
>they were doing with all of the CSS code. There was only one part that
>I did not quite understand...
>
>In most of the templates they were double wrapping tags for any
>content areas. example:
>
>#sidebar {
>  width:254px;
>  }
>#sidebar2 {
>  padding:2px 20px 10px;
>}
>
>Then in the html they have:
>
><!-- Begin #sidebar -->
><div id="sidebar"><div id="sidebar2">
>
>Why are they putting half of the tag in one div and the other half in
>another and in the html they always appear one right after the other?
>Couldn't they just combine both css into one id and then that would
>eliminate the second "wrapped" css id?

It's a workaround for the IE box model bug. In IE4-5.5 (and 6 if you
trigger Quirks mode) the padding is included in the width. In the CSS
specs and hence in most other browsers (and IE6 if you trigger
Standards mode) the padding is in addition to the width. Hence by
setting width and padding on different elements you get the same
presentation in both sets of browsers. There are other solutions to
the same problem but if you don't mind adding <div> soup to your pages
this one is both safe and simple.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie."  - The Doctor

Steve Pugh        <steve@pugh.net>        <http://steve.pugh.net/>


Post Follow-Up to this message ]
Re: CSS positioning div wrapping
 

DKode




quote this post edit post

IP Loged report this post

Old Post  06-16-04 - 05:15 PM  
Thank you!

This explains everything for me.

Is there anywhere I can look up various IE css bugs and solutions to
them? I plan on deploying a rather large (1000 users) application
developed in ASP.NET with all pages being CSS positioned and I want to
make sure I address most of the major bugs in IE 6.

Thanks again!

Steve Pugh <steve@pugh.net> wrote in message news:<p3nuc0ph5guks4rsmf2qjcv9auneqtocpj@4ax.c
om>...
> dkode@cfl.rr.com (DKode) wrote:
> 
>
> It's a workaround for the IE box model bug. In IE4-5.5 (and 6 if you
> trigger Quirks mode) the padding is included in the width. In the CSS
> specs and hence in most other browsers (and IE6 if you trigger
> Standards mode) the padding is in addition to the width. Hence by
> setting width and padding on different elements you get the same
> presentation in both sets of browsers. There are other solutions to
> the same problem but if you don't mind adding <div> soup to your pages
> this one is both safe and simple.
>
> 	Steve


Post Follow-Up to this message ]
Re: CSS positioning div wrapping
 

BenOne©




quote this post edit post

IP Loged report this post

Old Post  06-17-04 - 09:19 AM  
DKode wrote:
> Thank you!
>
> This explains everything for me.
>
> Is there anywhere I can look up various IE css bugs and solutions to
> them? I plan on deploying a rather large (1000 users) application
> developed in ASP.NET with all pages being CSS positioned and I want to
> make sure I address most of the major bugs in IE 6.



Check out this site:
http://www.positioniseverything.net/ie-primer.html

--
--
Ben Thomas - Software Engineer - Melbourne, Australia

This message and any attachments is/are intended for the person/s
to whom it was addressed. It may contain privileged or confidential
information. If you have received this message in error, please notify
the sender promptly and destroy the message without copying it or
divulging its contents to any person.

Opinions, conclusions, and other information in this message that do not
relate to the official business of my firm shall be understood as neither
given nor endorsed by it.



Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 04:09 AM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top