The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS ID’s issue. Unable to style.

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #44272

    [MOD EDIT] See Codepen referred to further down for code.

    My problem is that I am not able to style anything in div id=”try” and

    Why is that happening ? And why I am getting red color by default ? I haven’t specified any styling. Moreover the wrapper is styled as background-color:blue so even if the color had to come it should be blue, no? I am really frustrated and have been trying to solve it for past 1 day, but to no help.

    Looking forward for some solution ! Thanks! :)


    edit : I am not able to write html markup. Please take a look at

    Thanks :)


    You’ve put red as the background color of all paragraphs. So #try has it’s styles set, paragraph background color just is drawn on top of it.

    So your lesson here: write HTML that lets you target more precisely the element you want to have in red.


    Better yet, post your code into Code Pen.


    ^ Here you go :

    Thanks for the solution,I’ll try it asap


    The reason your blue background shows only behind the header is that the parent which is wrapper holds floated elements which are naturally taken out of document flow and wrapper acts like they not there at all and is collapsed to height of the header only. To fix that, you need to give wrapper overflow:hidden

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.