BenPSP
04-08-2010, 05:29 PM
Hi all,
Fairly new at HTML / CSS so this has got me confused :)
Trying to put text next to an image, or to be correct a background image of a div.
Here is a picture of what it looks like now: http://i985.photobucket.com/albums/ae339/BenKxK/nextoeachother.png
And here is what I want it to look like (fake): http://i985.photobucket.com/albums/ae339/BenKxK/dd.png
I tried using a margin but the text moved but pushed the image down as well.
Here is the HTML I used:
<fieldset>
<legend>XHTML Basics</legend>
<p class="right">In this exercise you will start to learn the basics of HTML / XHTML. The XHTML PDF will first guide you through making your first
website, which although basic, is where all web developers start! lists&table PDF will take you through just that, how to use and create lists and tables.
This PDF also teaches you how to use tables for layout, but this is not recommended, as CSS does a much better job, information on this can be found in the
extra reading section.</p>
<div class="files" id="xhtml">
<img src="Pictures/FileTypes/zip.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/XHTMLBasics.zip"><strong>XHTMLBasics.zip</strong></a><br/>
<img src="Pictures/FileTypes/pdf.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/01-xhtml.pdf"><strong>01-xhtml.pdf</strong></a><br/>
<img src="Pictures/FileTypes/pdf.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/01a-lists%26tables.pdf"><strong>01a-lists&tables.pdf</strong></a><br/>
<img src="Pictures/FileTypes/txt.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/content.txt">content.txt</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lquiz.gif">lquiz.gif</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lsmile.gif">lsmile.gif</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lwot.gif">lwot.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/layout_table.html">layout_table.html</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lists.html">lists.html</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/netskills.gif">netskills.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/other.html">other.html</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/small_logo.gif">small_logo.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/tables.html">tables.html</a>
</div>
</fieldset>
And here is the CSS (mostly to get the files sitting on the notepad lines):
div.files {padding-left: 7em;
padding-top: 4.4em;
line-height: 1.35em;
width: 15em;
background-image: url(Pictures/filesback.png);
background-repeat:no-repeat;}
Cheers :)
Fairly new at HTML / CSS so this has got me confused :)
Trying to put text next to an image, or to be correct a background image of a div.
Here is a picture of what it looks like now: http://i985.photobucket.com/albums/ae339/BenKxK/nextoeachother.png
And here is what I want it to look like (fake): http://i985.photobucket.com/albums/ae339/BenKxK/dd.png
I tried using a margin but the text moved but pushed the image down as well.
Here is the HTML I used:
<fieldset>
<legend>XHTML Basics</legend>
<p class="right">In this exercise you will start to learn the basics of HTML / XHTML. The XHTML PDF will first guide you through making your first
website, which although basic, is where all web developers start! lists&table PDF will take you through just that, how to use and create lists and tables.
This PDF also teaches you how to use tables for layout, but this is not recommended, as CSS does a much better job, information on this can be found in the
extra reading section.</p>
<div class="files" id="xhtml">
<img src="Pictures/FileTypes/zip.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/XHTMLBasics.zip"><strong>XHTMLBasics.zip</strong></a><br/>
<img src="Pictures/FileTypes/pdf.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/01-xhtml.pdf"><strong>01-xhtml.pdf</strong></a><br/>
<img src="Pictures/FileTypes/pdf.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/01a-lists%26tables.pdf"><strong>01a-lists&tables.pdf</strong></a><br/>
<img src="Pictures/FileTypes/txt.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/content.txt">content.txt</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lquiz.gif">lquiz.gif</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lsmile.gif">lsmile.gif</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lwot.gif">lwot.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/layout_table.html">layout_table.html</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/lists.html">lists.html</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/netskills.gif">netskills.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/other.html">other.html</a><br/>
<img src="Pictures/FileTypes/picture.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/small_logo.gif">small_logo.gif</a><br/>
<img src="Pictures/FileTypes/html.png" alt="**" class="icon" /> <a href="Exercises/XHTMLBasics/tables.html">tables.html</a>
</div>
</fieldset>
And here is the CSS (mostly to get the files sitting on the notepad lines):
div.files {padding-left: 7em;
padding-top: 4.4em;
line-height: 1.35em;
width: 15em;
background-image: url(Pictures/filesback.png);
background-repeat:no-repeat;}
Cheers :)