www.webdeveloper.com
Results 1 to 5 of 5

Thread: Links in DIV css

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Links in DIV css

    Hi all

    I am trying to make a sidebar with links that would link to the main body section of the page.

    I know how to do this with frames, with the target tag.

    In Css, is it a server side issue? I mean, when I preview the page (before publication) in Firefox or IE, and check the links, it opens a new window, instead of where I want it.

    I have been checking many other pages and don't see anything that would tell the link in the sidebar where to load....

    Hope this makes sense, and just wondering if it will be a server-side issue and I should stop worrying about it not going where it should, or if I am missing something

    Thanks!
    Ann

  2. #2
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    CSS is for presentation; it does not affect the functionality of the HTML. Without seeing your code, it's hard to ascribe a reason to your problem.
    FYI
    * My screen resolution is set at 1680x1050
    * I'm accessing your site through a T1 line
    * I'm probably viewing it using Firefox (unless browser is specified)

  3. #3
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    A link shouldn't open a new window unless the target tag is set, but the target tag is deprecated and shouln't be used now. The normal link action is to open the new page in the same window - if all your pages have the same navigation sidebar with styles and any images controlled by a common external css file, the css and images will be cached by the browser giving the impression that only the content changes.

  4. #4
    Join Date
    Jul 2008
    Posts
    2
    Thanks for all your help so far...please let me know what I am doing wrong....

    Ann

    in index.html...

    <div id="sidebar">
    <div id="menu">
    <ul>
    <li class="active"><a href="home.htm" title="home">Homepage</a></li>

    <li><a href="assisted living.htm" title="Assisted Living">Assisted Living</a></li>

    <li><a href="skilled nursing.htm" title="Skilled Nursing">Skilled Nursing</a></li>
    <li><a href="activity.htm" title="Activity">Activity</a></li>

    </ul>

    </div>


    then in the css file it says:


    #content {
    width: 700px;
    margin: 0 auto;
    background: url(images/img03.gif) repeat-y;
    }

    #extra {
    clear: both;
    height: 20px;
    background: url(images/img06.gif) no-repeat;
    }

    /* Content > Main */

    #main {
    float: right;
    width: 460px;
    background: url(images/img05.gif) no-repeat right top;
    color: #FFA954;
    }

    #main a {
    color: #FF7F00;
    }

    /* Content > Main > Welcome */

    #welcome {
    }

    /* Content > Main > Example */

    #example {
    }

    /* Content > Sidebar */

    #sidebar {
    float: left;
    width: 220px;
    background: url(images/img04.gif) no-repeat;
    color: #6BB3B3;
    }

    #sidebar a {
    color: #319595;
    }

  5. #5
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    That snippet looks ok, although index.html should really be the home page as it is what the browser will default to when the domain name is typed, and therefore the link for the home page should be pointing to index.html (unless you are setting up an entry page). If each of the other pages gets the same sidebar html code, and are linked to the same css file, all should be fine.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles