Solved

cleaner approach to nav structure

Posted on 2014-01-28
10
209 Views
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.

http://nsitedesigns.com/nsitedesigns/rammer/2.html
2.html
0
Comment
Question by:nsitedesigns
[X]
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
10 Comments
 
LVL 52

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.
0
 

Author Comment

by:nsitedesigns
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.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 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>
<html>
<head>
<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>
</head>
<body>
<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> 
  </div>
  </div>
</div>





    
 
    
    <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">
    <h1>Instructions</h1>
    <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>
  
</body>
</html>
  

Open in new window

body {
	font-family:Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
	font-size:1 em;
	line-height:1.4em;
	margin: 0;
	padding: 0;
	color: #717074;
	background-image:url(http://nsitedesigns.com/nsitedesigns/rammer/img/background.jpg);
	background-repeat:repeat;
	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; 
width:637px;
margin-left:95px;
}

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

	#nav li a {
color: #6d6e72; /*gray*/
display:block;
padding:40px 5px 5px 5px;/* top padding for m/o effect*/
text-decoration:none;
	font-size:1em;
	text-align:center;
	margin-right:15px;
	margin-top:4px;
	
	}

#nav ul {
	list-style: none ;
	display: inline ;}
	
#nav li a:hover {
text-decoration:none;
background-color: #96caba; /* lt teal*/
color:#fff;
    }
	
	#nav li ul {
   
    display: none;
    float: left;
    padding: 0;
    position: absolute;}
.footer{text-align:center;background-color:white;}
	

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:nsitedesigns
ID: 39815346
Thanks for your work.  However, it kinda messed up the layout.  See link below:
http://screencast.com/t/RKtGymC82O

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.

http://nsitedesigns.com/nsitedesigns/rammer/2.html
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 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>
</div>

Open in new window


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

Author Comment

by:nsitedesigns
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.
0
 

Author Comment

by:nsitedesigns
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.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 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">
</div>

Open in new window

0
 

Author Comment

by:nsitedesigns
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
0
 
LVL 52

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.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

733 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