1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can't seem to set h1 font size?

Discussion in 'CSS' started by maney, Nov 5, 2006.

  1. #1
    I'm having problems setting my h1 font size, I'm currently using this in my css file and its having no effect, does anybody know where I'm going wrong?

    
    }
    div.iconimage { 
    	padding-top: 13px; 
    	text-align: center;
    }
    #header h1{
    	font-size: 6px;
    }
    HTML:
    (ignore the div icon image, I was just putting it in context with the other stuff, its at the end of the document)

    Dan
     
    maney, Nov 5, 2006 IP
  2. M57

    M57 Peon

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't really tell before i see the whole CSS, but i'm guessing on the following have caused the issue:

    1. You're using inline styles for the headings you're trying to change (ex: <h1 style="font-size: 16px">heading</h1>)

    2. You've already set the size of headers within the HTML document (in the <head> part within <style> tags).

    3. There's a more specific declaration somewhere in the CSS file.
    for example:
    html #header h1 { ... }
    Code (markup):
    is more "powerful" than:
    #header h1 { ... }
    Code (markup):
    because it's more specific.


    *sigh* ok i'll stop here. How about you show us some code? ;)
     
    M57, Nov 5, 2006 IP
    maney likes this.
  3. iatbm

    iatbm Prominent Member

    Messages:
    5,151
    Likes Received:
    352
    Best Answers:
    0
    Trophy Points:
    360
    #3
    If your h1 is also a link you have to use

    #header h1 a {font-size: 6px} :D
     
    iatbm, Nov 5, 2006 IP
  4. maney

    maney Active Member

    Messages:
    1,130
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    90
    #4
    I had a look at what you were saying and I still couldn't get it to work, the code that you suggested may be the problem (<h1 style="font-size: 16px">) seems to do the job I want it to though so I've used that. Thanks for the help, green love for you :)
     
    maney, Nov 5, 2006 IP
  5. M57

    M57 Peon

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes, it will work, since inline style will override any other declarations you've written before. But remember, this way you'll have to edit each header should you ever change their size, which is really tiresome. So i suggest you try to find where you specified a font size for headers before. :)
     
    M57, Nov 6, 2006 IP