473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Vertical spacing of elements

In a couple of places on my webpages I have several items that I would
like to be arranged vertically.

URLS : http://www.voidspace.org.uk/python/index.shtml ,
http://www.voidspace.org.uk/python/weblog/index.shtml

(I'm aware of, and have fixed, some of the validation errors by the way
- not yet uploaded new version !)

One example is the sidebar, and another is a set of links at the bottom
of the weblog. At the moment I use <br /> to vertically space the
items. e.g.
<div class="indexblock" >
<a href="index.shtml">Front page</a><br />
<a href="index.xml">RSS Feed</a><br />
<a href="atom.xml">Atom Feed</a><br />
<a href="#index">Return to top</a><br />
</div>

The side bar is worse, I have a couple of <br /> between each item ! I
guess in the 'indexblock' I could make into a list, with no symbol (?),
or make 'a' tags block items (?).

In the sidebar I think I would have to wrap each item in a <div>, and
have a rule in the style sheet. This seems much more verbose. I thought
part of the point of using CSS was to *reduce* extraneous markup ?

Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Jul 21 '05 #1
2 3317
Here's a quick example, ripped directly out of one of my files:

ul.blocks li
{
list-style-type: none;
display: block;
font-size: x-small;
font-family: "Verdana", "Trebuchet", sans-serif;
}
ul.blocks li A:link,
ul.blocks li A:visited
{
background-color: #aaaaaa;
padding: 3px;
color: white;
}
ul.blocks li A:hover,
ul.blocks li A:visited:hover
{
background-color: #ff6600;
padding: 3px;
text-decoration: none;
}
ul.blocks li + li
{
margin-top: 1em;
}

This particular stylesheet makes the links look more like buttons; if
you don't like that, just get rid of the 3px padding and change the
colors. Use with HTML like this:

<ul class="blocks">
<li><a href="1.html">1</a></li>
<li><a href="2.html">2</a></li>
<li><a href="3.html">3</a></li>
</ul>

Hope this helps!

Jul 21 '05 #2

Benjamin Esham wrote:
Here's a quick example, ripped directly out of one of my files: [snip useful stylesheet example].. This particular stylesheet makes the links look more like buttons; if
you don't like that, just get rid of the 3px padding and change the
colors. Use with HTML like this:

<ul class="blocks">
<li><a href="1.html">1</a></li>
<li><a href="2.html">2</a></li>
<li><a href="3.html">3</a></li>
</ul>

Hope this helps!


Thanks. I think I'll use it ! Very helpful.
For the sidebar stuff I guess I'll have to use a liberal sprinkling of
divs...

Regards,

Fuzzy
http://www.voidspace.org.uk

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Analysis&Solutions | last post by:
Hi Folks: I've got a weird phenomenon going on with Internet Explorer on the Macintosh... The vertical cell borders are missing between the cells but appear above and below the cells! Here's...
3
by: Frank Wheeler | last post by:
Why am I unable to attain proper vertical alignment between a DIV and a TABLE here: http://www.whbvillage.com/agenda-archives/agendex.html The DIV is coded: <DIV style="float: left;...
13
by: Dave | last post by:
Hi, what Property and Values are used to space out further from one another the items in a list (assuming it's possible)? The default presentation is a bit "bunched up" for me. Thanks, Dave
1
by: Marek Mänd | last post by:
<style> ..menu{ background:yellow; font:12px Arial; } ..menu li{ margin-bottom:0; margin-top:0; padding-bottom:0; padding-top:0;
16
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly...
5
by: Goldy | last post by:
Hello, w/ code like this: <table border="0" cellspacing="0" cellpadding="0"> <asp:Repeater runat="server" id="op"> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <tr> <td...
2
by: larzeb2000 | last post by:
I made a vertical navbar using a background image for the buttons. When I tested under FF or Opera, it looks fine, with the buttons touching vertically. However, in IE6 the buttons are spaced apart...
1
by: dave8421 | last post by:
Hi, I have a (strict) html document with the following portion: <ul> <li><img alt="" src="images/image1.jpg" /></li> <li><img alt="" src="images/image2.jpg" /></li> <li><img alt=""...
1
by: quantass | last post by:
Just a quick question in regards to the Obout Tree View. How do i go about adjusting the horizontal spacing before & after the plus/minus button for each node seperately? Also how do i adjust the...
1
by: mactelesis | last post by:
I have searched for "vertical stretch, align, etc." and have tried (and failed) with all of the solutions to stretch the "#nav vertical" div so that it streches to the height of the page. As you can...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.