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.

CSS problem

Discussion in 'CSS' started by Exygen, May 8, 2018.

  1. #1
    My <main> doesn't respond to anything other than font-family. I have it display-style: block like most of my site which is successfully styled. Even if i make a div with and id # it doesn't style anything at all. What am I missing.

    #content {
        margin: auto;
        display: block;
        width: 70%;
        height: 100%;
        background: #06989;
        font: #FFF 14px Arial;
    }
    
        <div class="content">
        <h1>Welcome to Gelignite</h1>
        <hr>
        <p>Welcome to Gelignite</p>
        </div>
    Code (markup):

     
    Last edited by a moderator: May 8, 2018
    Exygen, May 8, 2018 IP
  2. Exygen

    Exygen Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    found the problem, i didn't do a full 6 digit hex for my color.
     
    Exygen, May 8, 2018 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Probably a typo, but your css selects id=content, while the html markup says the div has class=content.

    gary
     
    kk5st, May 9, 2018 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #4
    You also shouldn't be flipping the bird at accessibility with pixel metric fonts... or risking the oddball behavior of not redeclaring the line-height when changing the font-size. Percentage widths without a max-width are also a bit of a wonk.
     
    deathshadow, May 10, 2018 IP