I cant make a block


#1

This is my css code:
div {
position:relative;
height:500;
width:500;
background-color: #000;
}


#2

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.

.my-div

and not

my-div

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.


#3

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?


#4

It's random size. Doesnt matter.


#5

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