473,386 Members | 1,621 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,386 software developers and data experts.

vertical centering

Hi

Browser IE6

I have the following
doctype xhtml strict

<div id="logoboxwww.testers.com</div>

#logobox {
width: 150px;
height: 150px;
background-color: white;
float: left;
background-image: url(pics/logo.jpg);
text-align: center;
}
I want www.testers.com to be vertically centered in #logobox. Possible, how
?
Thanks
Sep 21 '05 #1
7 1819
Els
Bill wrote:
Hi

Browser IE6

I have the following
doctype xhtml strict

<div id="logoboxwww.testers.com</div>

#logobox {
width: 150px;
height: 150px;
background-color: white;
float: left;
background-image: url(pics/logo.jpg);
text-align: center;
}

I want www.testers.com to be vertically centered in #logobox. Possible, how
?


Give www.testers.com (I'm assuming you mean just that string of
characters, not an actual page or anything) a line-height of 150px.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Def Leppard - Too Late for Love
Sep 21 '05 #2
"Bill" <bi*************@hotmail.com> wrote:
<div id="logoboxwww.testers.com</div>
Invalid HTML.
I want www.testers.com to be vertically centered in #logobox.


http://www.student.oulu.fi/~laurirai/www/css/middle/

--
Spartanicus
Sep 22 '05 #3
Hi
I want www.testers.com to be vertically centered in #logobox. Possible,
how

Give www.testers.com (I'm assuming you mean just that string of
characters, not an actual page or anything) a line-height of 150px.


It works for that small string but what if the text lenght is double the
width ?
The text ends up taking 300px hight !!

There's no other way of v-centering text ?

Thanks
Sep 22 '05 #4
Els
Bill wrote:
Hi
I want www.testers.com to be vertically centered in #logobox. Possible,
how
Give www.testers.com (I'm assuming you mean just that string of
characters, not an actual page or anything) a line-height of 150px.


It works for that small string


Which is why I suggested it; your string was one domain name, no
spaces :-)
but what if the text lenght is double the width ?
The text ends up taking 300px hight !!
Indeed. Not an option.
The only other reliable method would be a one celled table.

If you know beforehand how many lines there are going to me, you could
just wrap them in a div and set a top and bottom margin, but that's
likely to fail when someone augments or diminishes the font-size.
There's no other way of v-centering text ?


Not one that I can think of.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Annie Lennox - Walking On Broken Glass
Sep 22 '05 #5
Hi Els
It works for that small string
Which is why I suggested it; your string was one domain name, no
spaces :-)


Right :-)
If you know beforehand how many lines there are going to me, you could
just wrap them in a div and set a top and bottom margin, but that's
likely to fail when someone augments or diminishes the font-size.
That's what I had in mind and also, think of a thumbnail with the 8.3
filename, size and weight. It's easier to have a h-v-centered caption than
to have several containers on top of each other. That way if you have more
or less lines to publish the total container adjusts itself to what you have
to display. That's one use of this.
Not one that I can think of.


Then to keep the most css in the script the best way would be to have a php
(or another language) function write the caption box.
Thanks
Sep 22 '05 #6
Els
Bill wrote:
If you know beforehand how many lines there are going to me, you could
just wrap them in a div and set a top and bottom margin, but that's
likely to fail when someone augments or diminishes the font-size.


That's what I had in mind and also, think of a thumbnail with the 8.3
filename, size and weight. It's easier to have a h-v-centered caption than
to have several containers on top of each other. That way if you have more
or less lines to publish the total container adjusts itself to what you have
to display. That's one use of this.
Not one that I can think of.


Then to keep the most css in the script the best way would be to have a php
(or another language) function write the caption box.


And how does php know the amount of lines if the visitor has his
font-size set to largest?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Bløf - Liefs uit Londen
Sep 22 '05 #7
Hi Els

And how does php know the amount of lines if the visitor has his
font-size set to largest?


Of course php can't see that. But it can collect the data entered and break
it in 2-3-4 areas to display it as a v-h-centered bock.

Thumbnails is an example but maybe not THE example.

I'm experimenting with CSS that's the reason of my questions, I try to find
the limits of CSS. Of course for the time being, it's far from what I can do
with it but I hope soon I'll be answering questions instead of asking them.
! ;-)
Thanks
Bill
Sep 23 '05 #8

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

Similar topics

8
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
10
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274"...
22
by: Mel | last post by:
i have a div with with 300 and height 100 i need to place a text centered withing this box, can someone please help ? thankx Mel
1
by: Kenneth | last post by:
Okay, I've been scouring Google for hours looking for a solution to this problem, but as of yet I can't find one. XHTML Transitional seems to specify that I can no longer set a table's height to...
3
by: Wayfarer | last post by:
I *HAVE* Googled the hell out of it, but there's nothing I can understand (in words of one syllable or less) that works for me. If you go to http://www.journeys.ws/layout.html, on the...
2
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...
2
by: Warren Sarle | last post by:
See http://www.w3.org/Style/Examples/007/center-example.html When I view this page in IE6 (with all current updates on Windows XP), it is not vertically centered as the page itself claims and as...
15
by: scott | last post by:
Hello, I'm working on updating some of my table-based sites to use CSS instead of tables. One of my sites has a header that is composed of three elements: A B C In my prior design, this was...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
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:
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
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
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,...
0
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...
0
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,...

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.