SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: css inheritance

  1. #1
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css inheritance

    I'm building my first stylesheet, and have run into problem.

    My stylesheet looks like this.

    Code:
    .login	
    	{	
    		position: absolute;
    		left: 600px;
    		top: 500px;
    		color: black; 
    		background: lightgrey;
    		font-family: verdana;
    		font-size: x-small;
    		border-style: dotted;
    		border-width: 2px;
    		padding: 10px
    	}
    
    H1.login
    	{
    		color: black;
    		font-family: verdana;
    		font-weight: bold;
    		font-size: large
    	}
    And this is the html-code
    Code:
    <P CLASS="login">
    <H1 CLASS="login">Login</H1>
    Welcome to log in.
    But it's just the header which get's into the box, not the rest of the text which end's up in the upper left corner of the screen.

    What am I doing wrong? I want to be able to define different styles for H1 to be used in diffrent areas of my site/page.

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If memory serves, you can't put a <h1> inside a <p>.

    try doing this in your html instead:
    Code:
    <div class="login">
    <h1>Login</h1>
    <p>Welcome to log in.</p>
    </div>
    And amending the "h1.login" in your CSS to ".login h1".


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •