Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
CSS
body {
    text-align: center;
}

header {
    height:100px;
    background:black;
    width:100px;
}



Weird thing is when I change the color using Backround:color:"blah" it changes but the header does not have a backround color probably some noob mistake somewhere I can link the HTML after if there is no issue here.
Posted
Comments
Sergey Alexandrovich Kryukov 5-Mar-15 18:19pm    
What is "CSS Header" and how can it possibly "pop up"? What do you mean? Stand-out contrast? Something else?
—SA
Member 11495876 5-Mar-15 18:34pm    
Im sorry, I meant I am trying to change the color of the header to something else other then my body. I can change the background color of the website to whatever color or image I want but for some reason I can't change the header or display and display:inline-block;

tell me if I am speaking incorrectly like I honestly would appreciate being corrected as much as possible.
Sergey Alexandrovich Kryukov 5-Mar-15 18:54pm    
Again, there is no such thing as "color of the Website", unless it means that you create a unified color schemes for all pages, which is not a technical problem.
It is not clear what you cannot change. Do you want this color constant on the page, or change on some events? Is so, you might need JavaScript (but not in all cases).
What have you tried so far?
—SA

1 solution

First of all, use correct names for CSS properties: color (it means foregroung) background-color, background, and so on.
How about consulting reference sources before writing something? :-)

—SA
 
Share this answer
 
Comments
Member 11495876 6-Mar-15 1:12am    
Hey man I am still messing with it so far nothing really, sorry for my lack of knowledge seriously I think I am the only guy on the posts asking HTML,CSS base questions lol but you really help the community out and the top experts is a genius idea really cool to see skilled programmers helping the community grow instead of just bashing me for not knowing the proper functions of this basic language. But I also wanted to ask you if you possibly know any site or maybe anything new out there maybe even something on this site that I can possibly associate myself with many programmers in my area? I know its a weird question and all but I would love to surround my self with more people that I can even observe and learn from would be amazing.
Member 11495876 6-Mar-15 1:18am    
just want to tell you that you nailed my problem THANK YOU

You led me to see how blind I was when I labeled my Header {} when I should have put H1{}
Sergey Alexandrovich Kryukov 6-Mar-15 8:36am    
You are very welcome.
"header" could be a valid class name, but, of course, if you can use element names for styles, it's always better, more concise code.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900