Skip navigation
Torkuda1234
Currently Being Moderated

container links

Jun 29, 2012 1:54 PM

Working with one of the out of the box templates, I noticed side bars with several links. Each link had its own container with a background color and everything. Essentially I want to know how to take a container in my header and change it into the same kind of link (only of course keep it in the header).

 
Replies
  • Currently Being Moderated
    Jun 29, 2012 2:16 PM   in reply to Torkuda1234

    We have no way of knowing what you are starting with and where you want to get without knowing which page you started with and where you want to make changes.  It's all about the code.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 2:19 PM   in reply to Torkuda1234

    Torkuda1234 wrote:

     

    Working with one of the out of the box templates,

    Which one? Which version of Dreamwweaver?

     

    Always include these details in your posts to ensure you get the best responses.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 2:28 PM   in reply to Torkuda1234

    Did you look at the code and try to copy that method?

     

    The links are ordinary HTML anchors contained in an unordered list -

     

        <ul class="nav">

          <li><a href="#">Link one</a></li>

          <li><a href="#">Link two</a></li>

          <li><a href="#">Link three</a></li>

          <li><a href="#">Link four</a></li>

        </ul>

     

    They work the way they do because of the CSS that targets links in the sidebar -

     

    ul.nav {

              list-style: none; /* this removes the list marker */

              border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */

              margin-bottom: 15px; /* this creates the space between the navigation on the content below */

    }

    ul.nav li {

              border-bottom: 1px solid #666; /* this creates the button separation */

    }

    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */

              padding: 5px 5px 5px 15px;

              display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */

              width: 160px;  /*this width makes the entire button clickable for IE6. If you don't need to support IE6, it can be removed. Calculate the proper width by subtracting the padding on this link from the width of your sidebar container. */

              text-decoration: none;

              background-color: #C6D580;

    }

    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */

              background-color: #ADB96E;

              color: #FFF;

    }

     

    Are you code-savvy enough to work your way through that?  If not, be aware that DW will quickly become very frustrating for you without this kind of knowledge under your belt.  The application will expect you to bring that to the table....

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 4:49 AM   in reply to Torkuda1234

    Let's say you linked a word. If the item was already a link Dreamweaver defaulted to attaching the class to the link itself

     

    Actually, you probably 'told' DW to do that with the following workflow:

     

    1.  Select the word in Design view

    2.  Use the Class field of the Property inspector to apply the class

     

    The resulting HTML would look like this - <a href="..." class="whatever">whatever</a>

     

    On the other hand, if your workflow was this -

     

    1.  Select the word

    2.  Apply the class using the Class field of the Property inspector

    3.  With the word selected enter the link in the link field

     

    the resulting HTML would look like this - <a href="..."><span class="whatever">whatever</span></a>

     

    In the first case, removing the link would also remove the class reference since the class is applied directly to the <a> tag.  In the second case, removing the link would leave the class reference on the containing <span> tag.  There is no functional difference in the behavior of the two links (i.e., whether the class is applied directly to the anchor tag or to a containing span tag).  Which method is optimal for your purposes really depends on how you want to structure your CSS, and what you intend to do with the additional <span> tag.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points