Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Text running to the L/R of a central vertical axis
Old 10-22-2005, 12:10 PM Text running to the L/R of a central vertical axis
Novice Talker

Posts: 5
Trades: 0
I would like to arrange short strings of text running down my web page,
to the left and right of the center line running from top to bottom,
I have defined in the style tag TEXT-ALIGN: center, how do I specify in my <div> tags that I want the text to appear a certain number of pixels to the left or right of the vertical centre line? If the text overlaps thats fine and I would like the effect to remain consistent irrespective of browser or screen size.

center
a specified dist to the left of centr
a specified dist to the right of centre

<html>
<head>
<style type="text/css">
#start {TEXT-ALIGN: center}

</style>
</head>
<body>
<div ID = "start"><h1>1st element centered</h1></div>
<div ID = "start"><h1>I would like this to appear a specified dist to the left </h1></div>
<div ID = "start"><h1>I would like this to appear a specified dist to the right</h1></div>
</div>
</body>
</html>

Thanks for any help
allmanm is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-22-2005, 02:19 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
First off;
You cannot have multiple elements with the same ID, if they are to have the same CSS properties use a class instead.
<hn> elements are block elements so do not need to be wrapped in an enclosing div.
Use padding to push your text from the right or left borders of the element. A header <h> as a block element will be 100% of the parent container.

Code:
<html>
<head>
<style type="text/css">
h1 {
  position:relative;
}
#hdr_ctr {
   text-align:center;
}
#hdr_lft {
  text-align:left;
  padding:0px 0px 0px 20px;
}
#hdr_lft {
  text-align:right;
  padding:0px 20px 0px 0px;
}

</style>
</head>
<body>
<h1 id="hdr_ctr">1st element centered</h1>
<h1 id=hdr_lft">I would like this to appear a specified dist to the left </h1>
<h1 id=hdr_rht">I would like this to appear a specified dist to the right</h1>
</body>
</html>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Text running to the L/R of a central vertical axis
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.82643 seconds with 12 queries