The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
Homework - Stubborn Navigation
Discuss Stubborn Navigation in the CSS Help forum on Dev Shed. Stubborn Navigation Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 25th, 2013, 10:43 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
Homework - Stubborn Navigation
I've recently been altering an existing website to become responsive/fluid/flexible.
One of the biggest issues I was having was how to get the nav more responsive.
I came across a good example at http://www.hongkiat.com/blog/responsive-web-nav/ and set about making it more in keeping with my website.
I'm actually stumped on something which is more than likely going to take you guys seconds to solve - making my links centre inside the nav div.
Make sure your browser is more than 767px (preferably > 800px) or you won't see the issue.
HTML
CSS
Thank you in advance!
|

January 25th, 2013, 12:46 PM
|
|
|
|
in your descurt.css file, line 204 nav li rule:
get rid of display:inline;
and add float:left; and padding: 0 22px;
this should bring each of the list items out to a nice equi-distant arrangement .
|

January 25th, 2013, 01:01 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
Thanks for the suggestion. I'm away from the computer at the moment but get the impression this wont allow the links to be flexible between browser widths 768-980px. Am I wrong? I'm looking for the padding between the links to increase/decrease as the browser window size changes.
I've achieved the centralling on my original concept at www.designercurtains.biz
|

January 25th, 2013, 04:38 PM
|
|
|
|
yea, that padding won't work for a variable width.
I'm not sure how to go about that.
|

January 25th, 2013, 04:59 PM
|
 |
CSS & JS/DOM Adept
|
|
Join Date: Jul 2004
Location: USA
|
|
rdbrotherton, are you aware that you're mixing XHTML 1.0 and HTML5? You should pick one (I recommend HTML5) and then fix the errors with the help of http://validator.w3.org/ and http://jigsaw.w3.org/css-validator/ (under "more options", make sure it's set it to use "CSS level 3").
I'll suggest a solution but I should mention that it doesn't work in older versions of IE, e.g. IE7. It is simply to give the list-items "display:table-cell" and the <ul> "display:table".
|

January 26th, 2013, 02:20 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
Quote: | Originally Posted by Kravvitz rdbrotherton, are you aware that you're mixing XHTML 1.0 and HTML5? You should pick one (I recommend HTML5) and then fix the errors with the help of http://validator.w3.org/ and http://jigsaw.w3.org/css-validator/ (under "more options", make sure it's set it to use "CSS level 3").
I'll suggest a solution but I should mention that it doesn't work in older versions of IE, e.g. IE7. It is simply to give the list-items "display:table-cell" and the <ul> "display:table". |
I had wondered as the <nav> tag was being used, but hoped it was just me not realising it was available before HTML5.
Thanks for the help.
|

January 27th, 2013, 09:51 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
Kravvitz - thanks for your help with that. I've re-written the page in HTML5 and started again with the navigation. I've gotten it to work well enough for my liking, however I seem to have found a strange bug.
Viewing on my iPhone, the menu appears how it should. I click the menu and it drops to reveal the links. The bug appears when I rotate my iPhone (to landscape), the links font appears to increase in size....
Solutions greatly appreciated, as always!
|

January 27th, 2013, 05:01 PM
|
 |
CSS & JS/DOM Adept
|
|
Join Date: Jul 2004
Location: USA
|
|
|

January 28th, 2013, 01:23 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
Quote: | Originally Posted by Kravvitz |
Awesome little tip there Kravvitz. Thanks for all your help on this subject
Will I ever retain any of this knowledge!?!?
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|