Thread: css

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    50
    Rep Power
    12

    css


    This is probably a newbie question,
    Code:
    <style>
    
    .menu {
    	background-color:003366;
    	width:150;
    	color: white;
    	text-align: center
    }
    
    .submenu {
    	position:absolute;
    	background-color:#222;
    	width:150;
    }
    </style>
    </head>
    This code seems to work just fine with my menu's but ifI place it inside a css file like this :

    Code:
    .menu {
    	background-color:003366;
    	width:150;
    	color: white;
    	text-align: center
    }
    
    .submenu {
    	position:absolute;
    	background-color:#222;
    	width:150;
    }
    and add
    Code:
    <link rel="stylesheet" href="style.css" type="text/css">
    it doesnt work. What am I doing wrong ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    69
    Rep Power
    12
    try putting it in the top of the css. If it works than there's something wrong in your stylesheet.
    b.t.w. width:150; should be width:150px;
  4. #3
  5. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    That is interesting, especially since you don't have a type="text/css" in your <style> tag.

    I'm also intrigued by your CSS. In .menu you use background-color:003366, then in .submenu you use background-color:#222. Strange that you use different styles of styles.

    Also, no need for position:absolute unless you're going to give it a top/left or other coordinates (I don't think).

    And proper CSS states you should have a color: with every background-color.
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    50
    Rep Power
    12
    Originally posted by tomnie
    try putting it in the top of the css. If it works than there's something wrong in your stylesheet.
    b.t.w. width:150; should be width:150px;
    Thank you Sir, there was indeed an error in my css file.

    Really appreciate your help

IMN logo majestic logo threadwatch logo seochat tools logo