Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#4 2006-07-03 22:41:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,126
Website GitHub

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

#5 2006-07-04 07:21:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,126
Website GitHub

Re: Width, \width and w\idth

Here’s an informative article on not using hacks.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB