Jump to content

Adding right justified anchor between div tag removes div background color

Peter Robinson

Recommended Posts

My aim was to place title on the left and my table of contents link on the right all on one line within my div tag which defines the color. only I loose the color defined in my div.  

Any suggestions how to solve this ?

<!DOCTYPE html>
<title>Test Page Title</title>
    .alignleft { float: left; }
    .alignright { float: right; }
    div.title1 {background-color:#07E9DA;}

    <h1><a name="TOC"></a>Table of Contents</h1>
        <li><a href="#section1">Section 1</a>

<div class="title1">
<!-- <h2><a name="section1" class="alignleft">Section 1</a></h2>  <a href="#TOC" class="alignright">ToC</a></p> -->
 <a name="section1" class="alignleft">Section 1</a> <a class="alignright" href="#toc">toc</a>
   <p>This is a paragraph.</p>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...