Forum Moderators: not2easy

Message Too Old, No Replies

DW Why two rules?

Two fairly similar rules. Why.

         

pettisson

12:01 pm on Apr 19, 2009 (gmt 0)

10+ Year Member



Hello. Im trying to make a basic site with a header and footer and two middle elements (menu and content).

I'm new to CCS ofc and I wonder why DW make two rules for the header and footer but not for the sidebar and maincontent (in my example: header and header h1). It seems to me unnecessary, but maybe you have the answere for me?

Below; Entire .CSS by DW's default. There no major changes in the both rules. Both use dadding and and only one use margin. And they both want to be related to my footer?


body
.twoColFixLtHdr #container
.twoColFixLtHdr #header
background: #DDDDDD;
padding: 0 10px 0 20px;

.twoColFixLtHdr #header h1
margin: 0; /
padding: 10px 0;

.twoColFixLtHdr #sidebar1
.twoColFixLtHdr #mainContent
.twoColFixLtHdr #footer
.twoColFixLtHdr #footer p
.fltrt
.fltlft
.clearfloat

Below; This is the HTLM document. I can only see the use of "header rule" there within "id" - so why do the rule "header h1" exists?


<div id="header">
<h1>Header</h1>
<!-- end #header --></div>

As I'm still learning and want to keep it simple I wonder why these doubles exists. I want to remove them - but maybe it's a logical reason for them when I'm making bigger websites later on.

Cuddles
Fredrik

CSS_Kidd

1:35 pm on Apr 20, 2009 (gmt 0)

10+ Year Member



This is something that DreamWeaver does. It is really creating two different rules. It is saying that this rule is only for the h1 in the .twoColFixLtHdr #header div. this is why it created .twoColFixLtHdr #header h1. It is a default thing it does. Using dreamweaver or any other program like is is good for a "example" visual (Design mode) But they tend to add or structure the code to what it wants to be. My advice, because I use dream weaver, is to keep using it if you feel that it helps you somewhat visually. But don't rely on it to fully form your pages. Always KNOW your code and keep an eye on things like this so you can correct them. And once you feel that you are confident enough to hand code, you can move over to just writing code in notepad or Notepad++ (<---Great for structuring). Then just use your browser for your visual.

pettisson

4:49 pm on Apr 21, 2009 (gmt 0)

10+ Year Member



Yeah now I get it with h1 etc. Thank you. And yeah I noticed that DreamWeawer is very hard to do CCS in (look at that image)

<snip>

It's so unreliable. Sometimes it shows great spaces between elements but when I load it in IE to check - of course it looks good.

I got crazy once when the text aligment where just out of order, not even ligning inside the box! But in IE it worked out perfectly! (centered both on x and y axle)

What I mean is, isn't DreamWeaver made for making websites or is CSS just an exception with flaws in DW? Do anyone really use DW to make CSS websites?

[edited by: swa66 at 4:57 pm (utc) on April 21, 2009]
[edit reason] NO URLs please see ToS and forum charter [/edit]