Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is margin possible for a <div> in css?

Tags:

html

css

xhtml

Is it possible to define a margin for a text area?

my wysiwyg editor places my text within <div> tags in stead of giving linebreaks <br />

So i thought giving the <div> a margin?

Is this possible in css? and if yes how?

Many thanks.

EDIT: I can't define the divs because it gets no classes. For example the editor makes it:

<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas lacus libero, et pellentesque nisl. Cras pharetra nunc sit amet urna vestibulum non ultricies metus malesuada. </div>
<div>Nulla tincidunt, neque at blandit ultrices, massa odio pulvinar est, vel accumsan sapien justo sit amet lorem.</div>

This looks like:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas lacus libero, et pellentesque nisl. Cras pharetra nunc sit amet urna vestibulum non ultricies metus malesuada.
Nulla tincidunt, neque at blandit ultrices, massa odio pulvinar est, vel accumsan sapien justo sit amet lorem.

But needs to be like this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas lacus libero, et pellentesque nisl. Cras pharetra nunc sit amet urna vestibulum non ultricies metus malesuada.

Nulla tincidunt, neque at blandit ultrices, massa odio pulvinar est, vel accumsan sapien justo sit amet lorem.

like image 710
Justmac Avatar asked Oct 13 '22 21:10

Justmac


1 Answers

You can change the margins of all <div>s in a container by writing

.MyContainer div {
    margin: 42px;
}
like image 179
SLaks Avatar answered Oct 16 '22 16:10

SLaks