473,748 Members | 10,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vertical center on images and text at the same line

I am trying to create a breadcrumb with both icons and text, looking
like:

[img] Home > [img] Trail > [img] Trail

Now, how on earth do I get the images and text to vertically align so
that the vertical center of the text is identical to the vertical center
of the images, with margins top and bottom as well as borders top and
bottom? And retain cross-browser compability?

-e

--
egil helland - http://egil.net
Feb 22 '06 #1
13 3149
eg*********@egi l.net (Egil Helland) wrote:
I am trying to create a breadcrumb with both icons and text, looking
like:

[img] Home > [img] Trail > [img] Trail
What are the images for? They seem at best useless, maybe worse.
Now, how on earth do I get the images and text to vertically align so
that the vertical center of the text is identical to the vertical center
of the images, with margins top and bottom as well as borders top and
bottom? And retain cross-browser compability?


How are the images coded, in the HTML or in CSS?

--
Spartanicus
Feb 22 '06 #2
Spartanicus <in*****@invali d.invalid> wrote:
eg*********@egi l.net (Egil Helland) wrote:
I am trying to create a breadcrumb with both icons and text, looking
like:

[img] Home > [img] Trail > [img] Trail


What are the images for? They seem at best useless, maybe worse.

Probably worse...
Now, how on earth do I get the images and text to vertically align so
that the vertical center of the text is identical to the vertical center
of the images, with margins top and bottom as well as borders top and
bottom? And retain cross-browser compability?


How are the images coded, in the HTML or in CSS?


HTML

--
egil helland - http://egil.net
Feb 22 '06 #3
eg*********@egi l.net (Egil Helland) wrote:
>[img] Home > [img] Trail > [img] Trail


What are the images for? They seem at best useless, maybe worse.

Probably worse...


Then you should remove them.

--
Spartanicus
Feb 22 '06 #4
Spartanicus <in*****@invali d.invalid> wrote:
eg*********@egi l.net (Egil Helland) wrote:
>[img] Home > [img] Trail > [img] Trail

What are the images for? They seem at best useless, maybe worse.

Probably worse...


Then you should remove them.


I would like to know how to do positioning like this, regardless of
whether you find the images useless here or not.

--
egil helland - http://egil.net
Feb 22 '06 #5
eg*********@egi l.net (Egil Helland) wrote:
>> >[img] Home > [img] Trail > [img] Trail
>>
>> What are the images for? They seem at best useless, maybe worse.
>>
>Probably worse...


Then you should remove them.


I would like to know how to do positioning like this, regardless of
whether you find the images useless here or not.


This is a discussion group, post here and we'll discuss the implications
of what you want to do. If you're lucky you'll get good advice on best
authoring practices. It's coincidental if that happens to match what you
want to do.

--
Spartanicus
Feb 22 '06 #6
eg*********@egi l.net (Egil Helland) wrote in
news:1hb5xrw.k4 enge12nb96wN%eg *********@egil. net:
I am trying to create a breadcrumb with both icons and text, looking
like:

[img] Home > [img] Trail > [img] Trail

Now, how on earth do I get the images and text to vertically align
so that the vertical center of the text is identical to the vertical
center of the images, with margins top and bottom as well as borders
top and bottom? And retain cross-browser compability?

-e


See http://alamo-smccann.nmsu.edu/ and hover over one of the menu items
below the row of pictures. Is that kind of what you want?

<div id="primaryNav" >
<ul>
<li id="current">< a href="/students/">Current Students</a></li>
<li id="prospective "><a href="/prospective/">Prospecti ve Students
</a></li>
<li id="faculty">< a href="/facstaff/">Faculty &amp; Staff</a>
</li>
<li id="alumni"><a href="/alumni/">Alumni</a></li>
<li id="visitors">< a href="/visitors/">Visitors</a></li>
</ul>
</div>

#primaryNav a:hover, #primaryNav a:active {
color:white;
background-color:#882345;
background: url("/image/arrow.gif") no-repeat left;
}
Note how the image is placed in the background. You could also use the
image with #primaryNav a:link, #primaryNav a:visited if you wanted it
visible all the time.
Then apply text-align:center to #primaryNav

HTH

--
Stan McCann, "Uncle Pirate" http://stanmccann.us/
Webmaster, NMSU at Alamogordo http://alamo.nmsu.edu/
Now blocking Google Grouper posts and replies.
http://blinkynet.net/comp/uip5.html
Feb 22 '06 #7
Stan McCann <me@stanmccann. us> wrote:
eg*********@egi l.net (Egil Helland) wrote in
news:1hb5xrw.k4 enge12nb96wN%eg *********@egil. net:
I am trying to create a breadcrumb with both icons and text, looking
like:

[img] Home > [img] Trail > [img] Trail

Now, how on earth do I get the images and text to vertically align
so that the vertical center of the text is identical to the vertical
center of the images, with margins top and bottom as well as borders
top and bottom? And retain cross-browser compability?

-e


See http://alamo-smccann.nmsu.edu/ and hover over one of the menu items
below the row of pictures. Is that kind of what you want?

<div id="primaryNav" >
<ul>
<li id="current">< a href="/students/">Current Students</a></li>
<li id="prospective "><a href="/prospective/">Prospecti ve Students
</a></li>
<li id="faculty">< a href="/facstaff/">Faculty &amp; Staff</a>
</li>
<li id="alumni"><a href="/alumni/">Alumni</a></li>
<li id="visitors">< a href="/visitors/">Visitors</a></li>
</ul>
</div>

#primaryNav a:hover, #primaryNav a:active {
color:white;
background-color:#882345;
background: url("/image/arrow.gif") no-repeat left;
}
Note how the image is placed in the background. You could also use the
image with #primaryNav a:link, #primaryNav a:visited if you wanted it
visible all the time.
Then apply text-align:center to #primaryNav

HTH


GRRRREAT! Thanks a lot, this was exactly what I wanted! :) You made my
day :)

-e

--
egil helland - http://egil.net
Feb 22 '06 #8
Spartanicus <in*****@invali d.invalid> wrote:
eg*********@egi l.net (Egil Helland) wrote:
>> >[img] Home > [img] Trail > [img] Trail
>>
>> What are the images for? They seem at best useless, maybe worse.
>>
>Probably worse...

Then you should remove them.


I would like to know how to do positioning like this, regardless of
whether you find the images useless here or not.


This is a discussion group, post here and we'll discuss the implications
of what you want to do. If you're lucky you'll get good advice on best
authoring practices. It's coincidental if that happens to match what you
want to do.


Wow, so you are the stylesheets group police? I did not notice those
stars and stripes on your shoulder! I worship you and the ground that
you walk on :)

Just rant and troll on all you want, I got a superb answer right on
topic from Stan McCann. Have a nice day! ;)

-e

--
egil helland - http://egil.net
Feb 22 '06 #9
Egil Helland wrote:
Wow, so you are the stylesheets group police?


No one ever expects the Stylesheets Group Police!

--
chromatic aberration
Feb 23 '06 #10

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

Similar topics

2
15553
by: chris_culley | last post by:
Hi, I'm fairly new to using css, and have been using it to format a vertical navigation bar on my website, producing a load of buttons on top of each other, each with a (151 * 33 px) gif as the background. I've customised the <a> tag as follows: a.menu {
2
12143
by: Eric Lindsay | last post by:
If I want to have the middle of an image vertically aligned with the middle of a heading (or several lines of heading), is there some particular way people would recommend? vertical-align: center looked made for that. The effect I want is img heading img heading img heading or heading
3
4422
by: acunnon | last post by:
I am trying to put together an login page my problem is getting the three items aligned to the middle verticaly without specifing a height to anything on the page. CSS html{ height:100%; min-height:100%; } body{ vertical-align:middle;
1
3486
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and the sidebar (right) doesn't center here's the css i'm modifying to center it. i apologise for the mess. <html> <head> <title>cris-kun's 'Blog - www.puff-x.com</title> <$BlogMetaData$>
8
3553
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag: body { font-family: Trebuchet MS, Arial; cursor : default; background:#000000 url("Images/long-template.jpg"); background-repeat:no-repeat; background-position: center; background-attachment:scroll; height: 1228px;
13
1662
by: Bill | last post by:
Hi How can I have IE7 act correctly on that ? The rules make the link text go down when hovered. It works in FF , I had to add a hard space right after the LI tag to have OP9 work but I can't figure how to have IE7 work. Why? How can I have it work in all 3 browsers? http://nrap.selfip.com
24
3627
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to show what I'm talking about. http://screencast.com/t/i5SLg3cAczH (*WARNING, TAKES A WHILE TO LOAD*) *HTML* <html> <head> <title>James Mann - Portfolio</title>
40
5494
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this: http://htmlhelp.com/reference/css/text/vertical-align.html
5
4129
by: wastedguitarist | last post by:
hey everyone, i have a site that i have designed in dreamweaver. In firefox, the site looks fine, but in IE the whole thing is vertically missalligned, apart from the header / menu. I have created the site using css, which i include below. the site can be viewed at http://www.catalystpics.co.uk/dev/index.html Thanks in advance to anyone who can help This is my css body { padding: 0;
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.