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

Line and text baseline alignment



Hello,

I try to align the baseline of my title with a white line using CSS. The
code does work with Safari Mac, Explorer Mac and PC, Firefox PC. But on
Firefox 1.5 Mac and Opera 6.03, the text shifts from the line. I don't
understand where these pixels come from (all units are in pixels):

<div style="color: #ffffff; font-size: 22px; font-weight: bold; position:
absolute; top: 188px; z-index: default;
margin-top:2px">Presentation</div><div style="position: absolute; z-index:
default; top: 210px; padding:0; width: 100%; border-style: solid none none;
border-width: 1px 0 0 0; border-color: #fff;"></div>

Thanks for any help,

Christophe

Jul 25 '06 #1
5 5335
Christophe <cm****@hotmail.comscripsit:
I try to align the baseline of my title with a white line using CSS.
This group is about HTML, not CSS.
<div style="color: #ffffff; font-size: 22px; font-weight: bold;
position: absolute; top: 188px; z-index: default;
margin-top:2px">Presentation</div><div style="position: absolute;
z-index: default; top: 210px; padding:0; width: 100%; border-style:
solid none none; border-width: 1px 0 0 0; border-color: #fff;"></div>
I would suggest that you learn HTML before considering stylistic issues.
Apparently the intention is to write a heading of some kind; in that case,
use a suitable heading element, such as <h1or <h2>. Later, consider how to
style it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jul 25 '06 #2
PTM
"Jukka K. Korpela" <jk******@cs.tut.fiwrote in message
news:_F*******************@reader1.news.jippii.net ...
Christophe <cm****@hotmail.comscripsit:
>I try to align the baseline of my title with a white line using CSS.

This group is about HTML, not CSS.
><div style="color: #ffffff; font-size: 22px; font-weight: bold;
position: absolute; top: 188px; z-index: default;
margin-top:2px">Presentation</div><div style="position: absolute;
z-index: default; top: 210px; padding:0; width: 100%; border-style:
solid none none; border-width: 1px 0 0 0; border-color: #fff;"></div>

I would suggest that you learn HTML before considering stylistic issues.
Apparently the intention is to write a heading of some kind; in that case,
use a suitable heading element, such as <h1or <h2>. Later, consider how
to style it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
you could also try merging your two divs into one, as below:
<div style='color:#fff; font-size:22px; font-weight:bold; position:absolute;
top:188px; margin-top:2px; border-bottom:1px solid #000; width:100%;
padding-bottom:0px:'>Presentation</div>

hope this helps.

Phil
Jul 25 '06 #3

Le 25.7.2006 23:54, dans vq******************@newsfe1-gui.ntli.net, «*PTM*»
<p.********@vodafone.neta écrit*:
you could also try merging your two divs into one, as below:
<div style='color:#fff; font-size:22px; font-weight:bold; position:absolute;
top:188px; margin-top:2px; border-bottom:1px solid #000; width:100%;
padding-bottom:0px:'>Presentation</div>
Thanks Phil for taking the time to help me and for your nice answer. I will
try your solution.

Christophe


Jul 26 '06 #4

Le 25.7.2006 23:03, dans _F*******************@reader1.news.jippii.net,
«*Jukka K. Korpela*» <jk******@cs.tut.fia écrit*:
>I try to align the baseline of my title with a white line using CSS.

This group is about HTML, not CSS.
Sorry, I didn't think it is so strange to ask questions about CSS in a HTML
USENET group.

>
><div style="color: #ffffff; font-size: 22px; font-weight: bold;
position: absolute; top: 188px; z-index: default;
margin-top:2px">Presentation</div><div style="position: absolute;
z-index: default; top: 210px; padding:0; width: 100%; border-style:
solid none none; border-width: 1px 0 0 0; border-color: #fff;"></div>

I would suggest that you learn HTML before considering stylistic issues.
Apparently the intention is to write a heading of some kind; in that case,
use a suitable heading element, such as <h1or <h2>. Later, consider how to
style it.
I'm taking your advice. And sorry not to be as smart as you.

Christophe

Jul 26 '06 #5
PTM
"Christophe" <cm****@hotmail.comwrote in message
news:C0******************@hotmail.com...
>
Le 25.7.2006 23:54, dans vq******************@newsfe1-gui.ntli.net, «
PTM »
<p.********@vodafone.neta écrit :
>you could also try merging your two divs into one, as below:
<div style='color:#fff; font-size:22px; font-weight:bold;
position:absolute;
top:188px; margin-top:2px; border-bottom:1px solid #000; width:100%;
padding-bottom:0px:'>Presentation</div>

Thanks Phil for taking the time to help me and for your nice answer. I
will
try your solution.

Christophe

my pleasure, any time
Jul 26 '06 #6

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

Similar topics

8
by: Paul Wake | last post by:
I have some endnotes in http://www.xmission.com/~wake/utahjuvenilelaw.html and to do so included the endnote numbers as superscript in the text of the article. The lines with endnote numbers are...
6
by: Craig Thomson | last post by:
How can I have some text aligned to the left of the page and some more text aligned to the right using only CSS without a table? SPAN doesn't have any alignment, and there is only a single DIV...
5
by: Geoff Hague | last post by:
(posted to both alt.html and c.i.w.a.s. as I'm not sure what, exactly, is at fault here) I'm doing a site re-design: http://www.captainsoftheworld.com/cotw/index.html...
1
by: Sachin | last post by:
Just as Font.Height property gets the line spacing, in pixels, of the given font, how to calculate the same when we have an image instead of a text between two lines. i.e if we insert an image in...
3
by: Simon Abolnar | last post by:
Is it possible to align headers and text in different way. Because with: dgts.GridColumnStyles(0).Alignment = HorizontalAlignment.Center alignment is set for all column (header and text). ...
0
by: VorTechS | last post by:
I'm having a problem with an inherited label, applying text rotation to aligned text. If text rotation is applied to the aligned text, the alignment goes 'nuts'. I can find no logic to what is...
15
by: Matthew | last post by:
Hi, I'm mainly a coder, PHP at the moment, but from time to time need to design and use some css. I've a css text alignment issue. Mostly to align text neatly in the past I've used tables....
18
by: W. Watson | last post by:
See Subject. It's a simple txt file, each line is a Python stmt, but I need up to four digits added to each line with a space between the number field and the text. Perhaps someone has already done...
0
by: sanamsalehi | last post by:
hello I send to items to Microsof t word with this code: Dim wdApp As Word.Application Dim oDoc As Word.Document Dim oRange As Word.Range 'Create new hidden instance of Word. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...

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.