[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


cleaner approach to nav structure

Posted on 2014-01-28
Medium Priority
Last Modified: 2014-02-05
Is  there a cleaner way to code this page?  I got it to work on a mac on safari, chrome and ff but it fails miserably in IE on a mac.  Seems to me there are a lot of div tags.  Maybe I could reduce that a bit and have it function better on ie.

Question by:nsitedesigns
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39815232
I wouldn't worry about ie on a mac.  ie9+/firefox/safari(mac)/chrome is where 95% or more of  your traffic is going to be on the desktop side.  Expect 20% to 50% on mobile/tablet using modern browsers.

Author Comment

ID: 39815240
Should I clean it up a bit?  Is it too code heavy?  Seems like some of the code is redundant but I could not get it to work without all the divs.
LVL 54

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 2000 total points
ID: 39815292
Those DW templates are pretty old.  I remember seeing the same from MX through cs5.5.  One of the things that template is doing is moving the side bar around and that may be creating issues.  

Here I have this loaded in bootstrap and placed the sidebar at the bottom.  It has the beginning of being responsive.

Does this look better on mac/ie? http://jsbin.com/padasQ_28350110/2/
<!DOCTYPE html>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<div class="container">
<div class="phone">   <p>(920) 458-9331</p></div>
<div class="header">
<div class="logo-container"><a href="index.html"><img src="http://nsitedesigns.com/nsitedesigns/rammer/img/logo.png" alt="Laura Rammer Dental Office" /></a> </div>
<div class="nav_container">
<div id="nav"><ul>
  <li><a href="#">Services</a></li>
  <li><a href="#">Meet Our Team </a></li>
  <li><a href="#">Links</a></li> 
  <li><a href="#">News/Events </a></li>
  <li><a href="#">Contact </a></li>
  <li><a href="#">Home</a></li></ul> 

    <img src="http://nsitedesigns.com/nsitedesigns/rammer/img/p_1.jpg" alt="Laura Rammer Dental Office" width="934" height="424" class="main_pic" />
  <div class="col-sm-9 content">
    <p>Be aware that the CSS for these layouts is heavily commented. If you do most of your work in Design view, have a peek at the code to get tips on working with the CSS for the fixed layouts. You can remove these comments before you launch your site. To learn more about the techniques used in these CSS Layouts, read this article at Adobe's Developer Center - <a href="http://www.adobe.com/go/adc_css_layouts">http://www.adobe.com/go/adc_css_layouts</a>.</p>
    <h2>Clearing Method</h2>
    <p>Because all the columns are floated, this layout uses a clear:both declaration in the .footer rule.  This clearing technique forces the .container to understand where the columns end in order to show any borders or background colors you place</p>
    <p>An image placeholder was used in this layout in the .header where you'll likely want to place  a logo. It is recommended that you remove the placeholder and replace it with your own linked logo. </p>
    <p> Be aware that if you use the Property inspector to navigate to your logo image using theackground color on any div will only show for the length of the content. This means if you're using a background color or border to create the look of a side column, it won't extend all the way to the footer but will stop when the content ends. If the .content div will always contain more content, you can place a border on the .content div to divide it from the column.</p>
    <!-- end .content --></div>
  <div class="col-sm-3 sidebar1">

    <h2>Gentle But Thorough</h2>
    <p>Buipsum dolor sit amet, consectetur adipiscing elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. </p>
    <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.</p>
    <p> John Doe      <br>
    Sheboygan, WI</p>
    <!-- end .sidebar1 --></div>
   <div class="col-sm-12 footer">
    <p>Dr. Laura J. Rammer DDS &nbsp;&nbsp; |&nbsp;&nbsp;  604 Michigan Avenue &nbsp;&nbsp; |&nbsp;&nbsp; Sheboygan, WI 53081 &nbsp;&nbsp; |&nbsp;&nbsp; (920) 458-9331</p>
    <!-- end .footer --></div>
  <!-- end .container --></div>

Open in new window

body {
	font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
	font-size:1 em;
	margin: 0;
	padding: 0;
	color: #717074;
	background-color: #8fb6a4; /*teal*/
.container {
	background-color: #FFF;
	margin: 30px auto 30px auto;

/*  ........ NAVIGATION .......*/
	.nav_container {
	float: left;
	width: 637px;
	padding-bottom: 30px;

	#nav {
display: inline-block; 

#nav ul li {
display:inline; /*needed for ie bug*/
height:72px; /*matches height of logo */

	#nav li a {
color: #6d6e72; /*gray*/
padding:40px 5px 5px 5px;/* top padding for m/o effect*/

#nav ul {
	list-style: none ;
	display: inline ;}
#nav li a:hover {
background-color: #96caba; /* lt teal*/
	#nav li ul {
    display: none;
    float: left;
    padding: 0;
    position: absolute;}

Open in new window

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 39815346
Thanks for your work.  However, it kinda messed up the layout.  See link below:

Ideally, I wanted the layout to look like below with the phone number upper right and the logo below phone number on left.  THe nav bar needs to be at same plane as the logo only pushed to the right.

LVL 54

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 2000 total points
ID: 39815399
I did that in less then 5 minutes time.  I think with a little tlc it could get that way.  I just wanted to introduce using a responsive library and css grid.

As far as the div's they are all good. My preference would be to put the right column mark up at after the the main content.

<div container >
    <div header></div>
    <div main></div>
    <div right></div>
    <div footer></div>

Open in new window

I checked out your orig link in ie 10 and it looked fine.

Author Comment

ID: 39815416
Good call on moving the sidebar below the content div.  I will make that change.  

As a sidenote, I took an 8 hour bootstrap online course.  Was interesting but intimidating.

Author Comment

ID: 39815438
p.s.  I am working with training wheels and trying to make this site responsive - thanks to your initial work and inspiration.  Where did you link to the css file for styling?  I only see the boostrap css.
LVL 54

Accepted Solution

Scott Fell,  EE MVE earned 2000 total points
ID: 39815590
Take it in steps and perhaps start out using only classes for xs like col-xs-6.  That way the page will be similar to a static  layout.

But when you get to responsive, you have to think through each page as to how it will look for each of the 4 sizes.  
Below will create a large main content area with a right sidebar for all screens except for the phone it will both the left and right will stack.  It's paint by numbers.  Once you get over the learning curve, it will go much faster and you will kick yourself for not adopting earlier.
<div id="main" class="row">
  <div id="left" class="col-xs-12 col-sm-9">
  <div id="right" class="col-xs-12 col-sm-3">

Open in new window


Author Comment

ID: 39815619
Cool - thanks.  

1.  How do I edit the bootstrap.css?
2.  How are you linking to MY css file?  I do not see it referenced in the html
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39815690
>  How do I edit the bootstrap.css?

You don't.  Instead, you should create a new css file typically called, "custom.css" and place your own styles for things like colors, fonts, navigation etc.  You want to load the custom.css after the bootstrap.css.

>How are you linking to MY css file?

Do you mean in the jsbin link?  http://jsbin.com/padasQ_28350110/2/edit?html,css,output
I added it in the css tab.  It acts like working in the "custom.css" file.

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

649 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