How to create an empty block?

5

How do I create a BLANK + TRANSPARENT block of 800px height per 1000px width? And why the code below does not work for this?

html

<div class="block"></div>

css

.block {
 height: 800px;
 width: 1000px;
}

With this, I'm trying to create spaces above and below the div .vitrine :

<div class="block"></div>
<div class="vitrine"></div>
<div class="block"></div>
    
asked by anonymous 15.06.2014 / 23:12

1 answer

3

You do not need invisible elements to create these spaces. In the case of your last example, simply apply margins in the div% with%:

<div class="vitrine"></div>
.vitrine { 
    height: 350px; 
    width: 100%; 
    background-color: #222; 
    margin-top: 800px;
    margin-bottom: 800px;
} 

You can simplify the CSS of the margins too:

margin: 800px 0; /* top/bottom = 800px, left/right = 0 */

link

    
16.06.2014 / 00:24