HTML background | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

HTML background

how i create black colour bar in top of the web page? need help!

25th Oct 2017, 1:03 PM
Sandaru Chamika
Sandaru Chamika - avatar
4 Answers
+ 5
see the CSS I added "background-color:#000;" here #000 is the hexadecimal code for black or you can simply write : "background-color:black; That's all
25th Oct 2017, 1:29 PM
RZK 022
RZK 022 - avatar
+ 5
Complete your HTML course and take CSS course so.
25th Oct 2017, 3:00 PM
Calviղ
Calviղ - avatar
+ 4
using a division tag . Just add it like this .......HTML........ <div id = "box">Any Text</div> ........CSS......... * { margin:0px auto; } #box { background-color:#000; position:fixed; width:100%; height:60px; }
25th Oct 2017, 1:11 PM
RZK 022
RZK 022 - avatar
+ 2
how i add a background colour to that box?
25th Oct 2017, 1:23 PM
Sandaru Chamika
Sandaru Chamika - avatar