Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trick nested HREF in a DIV.

Posted on 2006-10-31
3
Medium Priority
?
901 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
ID: 17847247
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
ID: 17847257
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 1500 total points
ID: 17847386
If you want to style it without changing the HTML at all, I'd suggest

.headingTwo a {
     float: right;
}
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

971 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