Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hspace and Vspace between Div tags.

Status
Not open for further replies.

UncleMortis

Programmer
Jan 28, 2003
120
AU
I turned my frames page into a single page and I used Div tags to put the links in. I already have a Div area floating on the right and the new links div is floating on the left. Inbetween, I have some text. How do I increase the space between the left Div tag and the text? It's looking a bit cramped.
 
you can set the margins of your <DIV> elements using margin: 5px; (this does all fours sides) or you can specify individual sides using margin-left: 5px; margin-top: 10px; etc...

If this isnt what you need then I suggest posting your code or posting a link to the site so we can see the problem ourselves.
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Code:
<div class=&quot;links&quot;>
<table align=center width=&quot;100%&quot; >
<tr align=center>
<td>
<h3><a href=&quot;home.html&quot;>Home</a><br></h3>
<h3><a href=&quot;services.html &quot;>Services</a><br></h3>
<h3><a href=&quot;networking.html &quot;>Networking </a><BR></h3>
<h3><a href=&quot;hardware.html &quot;>Hardware </a><br></h3>
<h3><a href=&quot;software.html &quot;>Software </a><br></h3>
<h3><a href=&quot;sun.html &quot;>Sun Systems </a><br></h3>
<h3><a href=&quot;links.html&quot;>Links</a><br></h3>
</td>
</tr>
</table>
</div>

<Div class=&quot;home1&quot; align=center>
A great way of featuring your business on the Internet at affordable rates. Why only advertise within your local community when you can make the world your local community?
</div>

<p><span class=&quot;dropcap&quot;>H</span>obson's Hosting provides web hosting solutions to business. A small business itself, Hobson's Hosting aims to provide personalised service to its clients by keeping its operations small.</p>

<p>A web site for your business is a great idea. A visitor to your site can find out about items you stock, prices and even take a virtual tour around your shop without ever leaving their home. A web site can turn a visitor to your site into a potential customer.</p>

<p>You can contact Hobson's Hosting <a style=&quot;background-color:black;text-decoration:underline&quot; href=&quot;hobsonshosting@yahoo.com.au&quot;>by E-mail</a>.
</p>
The div tags are floating left and right and the paragraph text is inbetween. The paragraph however is too close to the borders of the left div box.

While I'm on the subject. I placed the same div tag in for the links on all the pages. One page however doesn't show the page correctly, the background is missing behind the words. Why would it do this?
 
Div.home1 {padding:0.5em;
border-style:solid;
border-width:2px;
background-color:#4862b4;
color:#ffffff;
width:30%;
float:right}
Div.links {padding:0.5 em;
border-style:solid;
border-width:2px;
background-color:black;
color:#ffffff;
width:25%;
float:left}
 
Add cellpadding to the table?
Nest the content in another div and add padding is another way.
I found problems using margins for text, found it was better to use padding.


É ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top