navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Does ordering of elements matter?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Does ordering of elements matter?
Page: [1]
 
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
Does ordering of elements matter? - 2/8/2006 15:22:49   
I have been playing with the height attribute of a div. With my CSS like this:

<div style="border-style:solid;border-width:1px;border-color:#000000;height:100px">

IE (and Dreamweaver) ignores the height. However, if when I put the height element at the beginning like this:

<div style="height:100px;border-style:solid;border-width:1px;border-color:#000000;">

it sizes as it should. Are there some ordering rules?

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
Tailslide

 

Posts: 6272
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Does ordering of elements matter? - 2/8/2006 17:21:22   
I can't say I've ever come across it making a difference - apart from link styles which definitely do need a certain order. I add and subtract bits from rules all the time without problem...:) did you include a semicolon at the end of the first version as it's missing in the example above.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to BeTheBall)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Does ordering of elements matter? - 2/10/2006 12:54:58   
It seems to matter. Try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
	<TITLE>Untitled Page</TITLE>
	<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<div style="border-style:solid;border-width:1px;border-color:#000000";height:70px;></div>
</BODY>
</HTML>


Then try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
	<TITLE>Untitled Page</TITLE>
	<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<div style="height:70px;border-style:solid;border-width:1px;border-color:#000000";></div>
</BODY>
</HTML>


An empty div with the height declared at the end of the style attribute seems to collapse, but when I put the height first, it does not, at least in IE.


_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Tailslide)
BeTheBall

 

Posts: 6381
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Does ordering of elements matter? - 2/10/2006 12:58:24   
My bad. I have my closing quote for the style attributes in the wrong place. Chalk it up to poor cut and paste!

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to BeTheBall)
Tailslide

 

Posts: 6272
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: online

 
RE: Does ordering of elements matter? - 2/10/2006 13:09:12   
We'll pretend it never happened! :)

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Does ordering of elements matter?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts