Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-07-03 21:06:28
- rinswind
- New Member
- Registered: 2006-07-03
- Posts: 2
Width, \width and w\idth
When i was looking thru the original stylesheet from textpattern i noticed some weird constructions for setting the width on some elements.
#sidebar-1
{
float: left;
width: 150px;
\width: 150px;
w\idth: 150px;
margin-right: 5px;
padding-top: 100px;
}
So why is it done on like this? Is it a hack to get placement right in all the browsers? Or has it something to do with the genarating php code? Why these three different ways to write the width of the element?
Last edited by rinswind (2006-07-03 21:07:48)
Offline
#2 2006-07-03 21:25:22
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Width, \width and w\idth
Yep, it’s CSS hacks (Simplified Box Model Hack).
Offline
#3 2006-07-03 22:13:23
- rinswind
- New Member
- Registered: 2006-07-03
- Posts: 2
Re: Width, \width and w\idth
Well i did not see this specific solution, but i did not invest it for years though. But i am thinking of leaving it out all together and just present a non CSS html only version for older browsers and text browsers. Thus all the info on the site can be reached and it will not give me any headeaches. Just let it degrade nicely.
Offline
Re: Width, \width and w\idth
The problem is some of those hacks are for current browsers (IE 6).
The IE developers are advising you to serve Internet Explorer (the main culprit) it’s own set of rules for problem cases and to avoid such parsing hacks in the css as some hacks have been ‘corrected’ in the upcoming IE 7 and won’t behave the same ways as in IE 6. More info here or via google.
The way to go about it is get it working for firefox and co first, then adjust your css to work with the internet explorer and save only those css rules that are needed to correct the IE-layout into a second css file. Then use those If IE conditionals to load those extra rules for the Internet explorer only.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Width, \width and w\idth
Here’s an informative article on not using hacks.
TXP Builders – finely-crafted code, design and txp
Offline
Pages: 1