Ronaldo
Ronaldo

Reputation: 367

put two divs on same line using margin

I'm trying to put the divs div.mes and div.vazio on same line. If I remove the margin from two divs (QuadroPrincipal and ul_mes) I get the result I want.

The problem is that I need divs mes and vazio on same line keeping the margins on elements quadroPrincipal and ul_mes.

Take a look: http://jsfiddle.net/4Zjx8/5/

I want to build this example:

example

Upvotes: 0

Views: 156

Answers (2)

imakeitpretty
imakeitpretty

Reputation: 2116

First, give div#ListaEventosPorMes a width.

Then float:left .mes and .vazio and give each of those a width that adds up to less than the width of the div.

Upvotes: 0

RobIII
RobIII

Reputation: 8821

How about not making .mes's width 100%? Also, you need to specify what behaviour you need; should .vazio be displayed partially? Should .mes give way and become less wide? Do you actually need percentages? Is the container a fixed width so the widths in the example/fiddle would always be some known value? (e.g. if container width = 1000 and .foo would be 75% it would always be 750px (exluding margins etc.)).

Upvotes: 1

Related Questions