Solved

Trick nested HREF in a DIV.

Posted on 2006-10-31
3
877 Views
Last Modified: 2012-06-27
.headingTwo {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 8pt;
      display: block;
      margin: 0px;
      background-color: #CCCCCC;
      color: #6c6666;
      height: 25px;
      vertical-align: middle;
      line-height: 145%;
      text-indent: 10px;
      background-image: url(xxxxxxx);
      background-repeat: repeat-x;
      background-position: top;
      font-weight: bold;
}

<table>
     <tr><td>
          <div class="headingTwo" >My Title <a href="http://mydomain.com" >mydomain.com</a></div>
     </td></tr>
</table>


How do I style the HREF so that the link shows up on the right side of the DIV tag and the Title Shows up on the Left side?
I can't use tables and I need to work with what I have...

0
Comment
Question by:rpong
3 Comments
 
LVL 30

Expert Comment

by:callrs
Comment Utility
Change
     display: block;
to
     display: inline;

and then use this:
          <div class="headingTwo" >My Title </div><a href="http://mydomain.com" >mydomain.com</a>
0
 
LVL 16

Expert Comment

by:manav_mathur
Comment Utility
cannot you create an additional div with horizontal-align=right, and enclose the link in that div??
0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 500 total points
Comment Utility
If you want to style it without changing the HTML at all, I'd suggest

.headingTwo a {
     float: right;
}
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now