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

    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0

    CSS Beginner - External Style sheet- HELP


    Hi;

    Is the first time that I am using CSS and I am trying to create an external style sheet but is not working. I have look videos, tutorials, manuals and I donít see why is not working. My Html page don't grab the style of my style sheet.

    This is my style sheet:


    Code:
    *{padding:5; margin:0;}
    a{text-decoration:none;}
    
    .main {width: 700px; margin-left:auto; margin-right:auto;}
    
    .header {background-color:#04B4AE}
    .header h1 {color:black; line-height:80px; font-size: xx-large;}
    .header img {float:left; height:70px; width:100px; padding: 5px; margin-right:20px}
    
    .menu {background-color:#04B4AE}
    .menu {margin: 0px; list-style-type:none; float: left; height:500px;}
    
    .center {background-color:#380B61; color yellow;
    		float:left; width:150px}
    .center h1 { font-size:large;}
    .center p{ text-align: justify;}
    .center h2{font-style: italic; font-size:small;}
    
    .footer {clear:left; background-color: #04B4AE; font-size: x-small;}
    And this is my Html page:

    Code:
    <html>
    <head> 
    
    	<link rel="stylesheet" type="text/css" href="style1.css"/>
    
    </head>
    <body>
    
    <div class="main">
    
    		<div class="header">
    		<img src="logo.jpg" alt="logo"/>
    		<h1>HTML PAGE USING EXTERNAL CSS</h1>
    		</div>
    		
    		<div class="menu">
    		<li> <a href="index.html">Home</a> </li>
    		<li> <a href="home.html">Rentals</a> </li>
    		<li> <a href="home.html">Registration</a> </li>
    		</div>
    		
    		<div class="center">
    			<h1> HTML PAGE USING EXTERNAL CSS</h1>
    			
    		</div>
    		
    		<div>
    		<h1> (c)me. </h1>
    		</div>
    	</div>	
    </body>	
    </html>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0
    Works fine check your file path of the stylesheet.
    I.e: style1.css is in /home/file/style.css
    Make sure its linked to that directory.

    Also good habit to use div ids instead of classes.
    Classes can be used multiple times which is good for some things. an id can be used once.
    Also get in the habit of ordering your styling a little neater because it will be easier to read.
    Such as
    Code:
    .menu {
    	margin: 0px; 
    	list-style-type:none; 
    	float: left; 
    	height:500px;
    	}
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    Bhopal
    Posts
    3
    Rep Power
    0

    thanks


    Thanks for your information.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by lysergic
    Works fine check your file path of the stylesheet.
    I.e: style1.css is in /home/file/style.css
    Make sure its linked to that directory.

    Also good habit to use div ids instead of classes.
    Classes can be used multiple times which is good for some things. an id can be used once.
    Also get in the habit of ordering your styling a little neater because it will be easier to read.
    Such as
    Code:
    .menu {
    	margin: 0px; 
    	list-style-type:none; 
    	float: left; 
    	height:500px;
    	}
    Thank You for your help

IMN logo majestic logo threadwatch logo seochat tools logo