Avatar billede cot Nybegynder
21. januar 2009 - 10:19 Der er 4 kommentarer og
1 løsning

Div ved siden af hinanden

hey!

Jeg prøver at lave lidt webdesign med Div-tags...

Men jeg kan ikke finde ud af at få 3 ind ved siden af hinanden, uden at det skal gå ned i næste linje :S

Min kode ser således ud:

<body><div style="margin-left:auto; margin-right:auto; width:800px;">
<div style="background-image:url(images/index_01.gif); width:800px; height:122px; background-repeat:no-repeat;"></div>
<div style="background-image:url(images/index_02.gif); width:800px; height:134px; background-repeat:no-repeat;"></div>
<div style="background-image:url(images/index_03.gif); width:800px; height:160px; background-repeat:no-repeat;"></div>
<div style="background-image:url(images/index_04.gif); width:305px; height:109px; background-repeat:no-repeat;"></div>
<div style="background-image:url(images/index_06.gif); width:307px; height:109px; background-repeat:no-repeat; float:right;"></div>
<div style="background-image:url(images/index_05.gif); width:188px; height:109px; background-repeat:no-repeat; float:right;"><img src="images/index_05.gif" width="188" height="109" /></div>
</div>
</body>

Det ser sådan ud:
http://www.traviannews.dk/noeci/
Avatar billede kalp Novice
21. januar 2009 - 10:25 #1
tjek lige din width på dine divs...
leg lidt videre med dette..

<body>
<div style="margin-left:auto; margin-right:auto; ">
<div style="background-image:url(images/index_01.gif); width:100px; height:122px; background-repeat:no-repeat;float:left;"></div>
<div style="background-image:url(images/index_02.gif); width:100px; height:134px; background-repeat:no-repeat;float:left;"></div>
<div style="background-image:url(images/index_03.gif); width:100px; height:160px; background-repeat:no-repeat;float:left;"></div>
<div style="background-image:url(images/index_04.gif); width:305px; height:109px; background-repeat:no-repeat;"></div>
<div style="background-image:url(images/index_06.gif); width:307px; height:109px; background-repeat:no-repeat; float:right;"></div>
<div style="background-image:url(images/index_05.gif); width:188px; height:109px; background-repeat:no-repeat; float:right;"><img src="images/index_05.gif" width="188" height="109" /></div>
</div>
</body>
Avatar billede cot Nybegynder
21. januar 2009 - 12:47 #2
de skal jo ikke være på 100?

Så kommer hele baggrunde jo ikk med?
Avatar billede ssv Nybegynder
21. januar 2009 - 12:53 #3
<div style="margin: 0 auto; width:800px;">
    <div style="background:url(http://www.traviannews.dk/noeci/images/index_01.gif) no-repeat; width:800px; height:122px; float: left"></div>
    <div style="background:url(http://www.traviannews.dk/noeci/images/index_02.gif) no-repeat; width:800px; height:134px; float: left"></div>
    <div style="background:url(http://www.traviannews.dk/noeci/images/index_03.gif) no-repeat; width:800px; height:160px; float: left"></div>
    <div style="background:url(http://www.traviannews.dk/noeci/images/index_04.gif) no-repeat; width:305px; height:109px; float: left"></div>
    <div style="width:188px; height:109px; float: left;"><img src="http://www.traviannews.dk/noeci/images/index_05.gif" width="188" height="109" /></div>
    <div style="background:url(http://www.traviannews.dk/noeci/images/index_06.gif) no-repeat; width:307px; height:109px; float:left;"></div>
</div>
Avatar billede cot Nybegynder
21. januar 2009 - 15:18 #4
takker :)

smid et svar!
Avatar billede ssv Nybegynder
21. januar 2009 - 15:57 #5
Og et svar skal du få :-)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester