Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
cloudthumper #1
Vertical Alignment on Rollovers Using CSS
Greetings --
I want to use CSS to create a text and image rollover for my navigation. The
image rolls over just fine but my text insists on a vertical alignment of top
instead of middle. I have set every parameter I can think of to get the text to
align itself as I wish but no matter what I try it always aligns to the top.
I have attached the style sheet text.
P.S. Horizontal alignment is no problem. It aligns to the center as it should.)
Thanks.
Cloudthumper
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
a:link {
height: 45px;
width: 142px;
display: block;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #006666;
text-decoration: none;
height: 45px;
width: 142px;
font-weight: bold;
background-image: url(images/button-1.jpg);
vertical-align: middle;
text-align: center;
}
a:hover {
height: 45px;
width: 142px;
display: block;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF0000;
text-decoration: none;
height: 45px;
width: 142px;
font-weight: bold;
background-image: url(images/button-2.jpg);
vertical-align: middle;
text-align: center;
}
-->
</style>
cloudthumper Guest
-
Vertical text-alignment in ComboBox
Hai there, I'm trying to adjust the text alignment/placement of the text displayed in a combobox, the box height is 18 px but the text inside... -
Vertical text alignment in menu spry
I tried to search this topic with no success. I have created a horizontal spry menu bar. I cannot get the text to align vertically. Everything... -
Vertical alignment in table cells
If I create a table and then merge several cells vertically, I can enter some text and can set the vertical alignment of the new 'spanned' cell to... -
Text box vertical alignment... is it possible?
Well the title said it all... except this: if it is, how?!? -
Data Browser vertical alignment problem
We want to use the features of the data browser in an update to our existing C++ project, but I'm stuck on doing vertical alignment. Alignment... -
mzanime.com #2
Re: Vertical Alignment on Rollovers Using CSS
Well, first of all, there is no need to repeat all of those properties over and
over, since most of them are the same, most of them can be simply specified
once, in the <a> element. Use shorthand properties too when you can, to reduce
code.
a {
display: block; font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px; color: #F00; height: 45px; width: 142px;
font-weight: bold;vertical-align: middle; text-align: center;
}
a:link { background-image: url(images/button-1.jpg); }
a:visited { background-image: url(images/button-1.jpg); }
a:hover { background-image: url(images/button-2.jpg); }
a:active { background-image: url(images/button-2.jpg); }
mzanime.com Guest
-
cloudthumper #3
Re: Vertical Alignment on Rollovers Using CSS
Thanks for your help Michael.
My problem, however, centers around the text not the image. I want the text
that I use as the button label to be centered both horizontally and vertically.
This is text as text not text as a graphic. The text slams itself at the top of
the table cell not in the middle as I want. I have used every option that I can
think of to center the text vertically but to no avail. As an example, I have
posted a representative problem page at:
[url]http://www.meatballweb.com/css-test/test-css.html[/url]
I'm beginning to think that it's a flaw in the way css rules are applied by
both Firefox and IE. Both yield the same results.
Any assistance would be most welcome.
Thanks.
Cloudthumper
cloudthumper Guest



Reply With Quote

