I cant make a block


This is my css code:
div {
background-color: #000;


Are you trying to apply it to a specific div?
In your html code you could have something like

<div class="my-div">Some text inside</div>

And then modify your css code so it looks like

.my-div {
position: relative;
height: 500px;
width: 500px;
background-color: #000;

So you can change the name of my-div to be whatever you want as long as you change it in both the html and the css, and since it's a class and not an id you would use a dot before it on the css code.


and not


You would also set the attribute for the height and width. So 500px which stands for 500 pixels. There are different options other than pixels also. Hope this helps.


i do not understand b4x answer (yes, i do understand what is he is doing, but not why)

@rubysurfer23364, your div are 500 what high? cows? :stuck_out_tongue: sorry, to tempting. Your width and height should have a unit of measurement. i guess they are 500px?


It's random size. Doesnt matter.


the fact that it is random, doesn't mean it shouldn't have a unit of measurment