Need help on how to implement CSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mazzer94
    New Member
    • Feb 2014
    • 1

    Need help on how to implement CSS

    Hello, I am having trouble implementing CSS on my HTML page...

    This is currently my CSS page:

    Code:
    #container
    {
    	width: 960px;
    	min-width: 960px;
    	padding-left:10px;
    	padding-right: 10px;
    	padding-top: 10px;
    	padding-bottom: 10px;
    	margin-left: auto;
    	margin-right: auto;
    	margin-top: 10px;
    	border: 2px solid #000000;
    }
    
    h1
    {
    	font-family: Verdana,Arial, Helvetica, sans-serif;
    	text-align: left;
    }
    
    p
    {
    	font-family: Verdana, Arial, Helvertic, sans-serif;
    	text-align: left;
    }
    
    .red
    {
    		color: #ff0000;
    }
    
    .centre
    {
    	text-align: center;
    }
    
    .justify
    {
    	text-align: justify; 
    }
    I than wrote my link to my css page under the <head> tag. This is what I wrote:

    <link href="styles.cs s" rel="stylesheet " type="text/css" />

    I than wrote... <h1 class="centre" >My Story</h1>

    ...it is meant to centre the text but instead doesn't centre it at all.

    Please let me know if you can help me solve this issue...

    Cheers!!
    Last edited by Rabbit; Feb 28 '14, 04:23 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Works fine for me. Are you sure your CSS file is in the correct location and named correctly?

    Comment

    • Foosoowangdu
      New Member
      • Mar 2014
      • 1

      #3
      Mazzer,
      Remove text-align:left from h1 in stylesheet

      Comment

      • Provision
        New Member
        • Mar 2014
        • 5

        #4
        If you're linking the css page to the html, make sure that you have a folder with both the files in it or they won't connect

        Comment

        • Bala Kumaran
          New Member
          • Jan 2013
          • 30

          #5
          Try this...

          Code:
          <div class="centre"><h1>My Story</h1></div>

          Comment

          Working...