Solved

Different text alignment on same line via CSS

Posted on 2012-04-13
2
616 Views
Last Modified: 2012-04-13
I am trying to display text on the same line that has 2 different types of alignment (see image below).  I want to display a word that is displayed in the center of the page and on the same line display a word that is right aligned.  Is this possible to do?  If so what is the style that I would use?

Example of desired text display
0
Comment
Question by:WestCoast_BC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Aeriden earned 500 total points
ID: 37844565
This is what I do, CSS-wise (adjust the margin-bottom value based on the text size and other layout):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Test Page</title>
<style type="text/css">
div.style1 { text-align: center; margin-bottom: -20px}
div.style2 { text-align: right; }
</style>
</head>

<body>
<div class="style1">center</div><div class="style2">right</div>

</body>

</html>
0
 

Author Comment

by:WestCoast_BC
ID: 37844626
Thanks, this works.  I was doing what you suggested except I was missing the margin-bottom part.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WordPress 8 71
.CSS HTML Help 3 58
type of website 13 53
wordpress theme 8 40
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question