| | #1 |
| Active Warrior Join Date: 2015
Posts: 49
Thanks: 85
Thanked 0 Times in 0 Posts
|
Hi guys, i went trough my code and possibly I've found the "problem". can anyone give me a tip how to overcome? my code for the two menus is following: HTML Code: <header> <nav id="navigation"> <a class="menu_button" onClick="toggleNav(); return false;"><i class="fa fa-globe fa-2x"></i></a> <ul id="navigation_list" role="navigation"> <li><a href=#>item</a></li> <li><a href=#>item</a></li> <li><a href=#>item</a></li> <li><a href=#>item</a></li> <li><a href=#>item</a></li> <li><a href=#>item</a></li> </ul> </nav> <a class="to_nav" href="#primary_nav"> <i class="fa fa-bars fa-2x"></i> </a> </header> )my "primary_nav" is at the bottom of the page and I use pure css code to access it. now the problem is: i can't display my menu icons inline (globe and bars) in mobile version of my site (I'm creating responsive website). I think the cause is that I have "nav" on the one hand and no-nav on the other. any clues on how to fix it? |
|
“Watch your thoughts, they become words; watch your words, they become actions; watch your actions, they become habits; watch your habits, they become character; watch your character, for it becomes your destiny.” F.O. | |
| |
| | #2 |
| Webmaster Join Date: 2008 Location: Boston, MA
Posts: 531
Thanks: 6
Thanked 65 Times in 58 Posts
|
Hi, there are a lot of possibilities, can you provide any live example of that?
|
| | |
| |
| | #3 |
| Web Developer Join Date: 2015 Location: Bangladesh
Posts: 37
Thanks: 0
Thanked 6 Times in 6 Posts
|
You can try display:inline-block to fix it, or you have to fix it in media query Thanks |
| I can fix website issues only $5 | |
| |
| The Following User Says Thank You to Sowkat Hossain For This Useful Post: |
| | #4 |
| HyperActive Warrior Join Date: 2013
Posts: 180
Thanks: 36
Thanked 28 Times in 25 Posts
|
As Sowkat Hossain said, apply inline-block to the elements that are not displaying that way. If you are not positioning your ul and li, or you are not styling them in a way that will force the position of their links, it can be as simple as: Code: #navigation a, a.to_nav {display:inline-block;} Code: #navigation, #navigation a, #navigation ul, a.to_nav {display:inline-block;} Code: #navigation, #navigation a, #navigation ul, #navigation li, a.to_nav {display:inline-block;} BTW, you can also target those elements from the header tag, like: Code: header a {display:inline-block;} Just a warning: inline-block elements have a blank space between them (as they should), and the easiest way to remove those spaces is to remove any space in your code: Code: <header>
<nav id="navigation"> <a class="menu_button" onClick="toggleNav(); return false;"><i class="fa fa-globe fa-2x"></i></a><ul id="navigation_list" role="navigation"><li><a href=#>item</a></li><li><a href=#>item</a></li><li><a href=#>item</a></li><li><a href=#>item</a></li><li><a href=#>item</a></li><li><a href=#>item</a></li></ul></nav><a class="to_nav" href="#primary_nav"> <i class="fa fa-bars fa-2x"></i> </a>
</header> ![]() Removing spaces in code makes it harder to read/edit, but the less spaces/tabs in your code, the more bits you save and the faster the page loads. One thing for the other. Another option would be to float elements, but that can have more drawbacks. Or what I do, relative/absolute positioning of every element, but it can be harder to do properly, specially in responsive designs. |
|
[...]
| |
| |
| The Following User Says Thank You to arojilla For This Useful Post: |
| | #5 |
| HyperActive Warrior Join Date: 2008 Location: Pensacola, FL
Posts: 449
Thanks: 1
Thanked 71 Times in 68 Posts
|
you may want to check your @media queries to make sure you are not display:none the icons container at whatever breakpoint
|
| Premium WooCommerce & WordPress Plugins $10/ea. or FREE With Membership. PluginForage.com | |
| |
| The Following User Says Thank You to totalprocessing.net For This Useful Post: |
| | #6 | |
| Web Developer Join Date: 2015 Location: Bangladesh
Posts: 37
Thanks: 0
Thanked 6 Times in 6 Posts
|
arojilla Sowkat Hossain did not say any way, he only said the property value. If you thought that your answer is the right you should satisfy with yourself not to refer anyone. It is not politeness. | |
| I can fix website issues only $5 | ||
| |
| | #7 |
| HyperActive Warrior Join Date: 2013
Posts: 180
Thanks: 36
Thanked 28 Times in 25 Posts
| |
|
[...]
| |
| |
| | #8 |
| Active Warrior Join Date: 2015
Posts: 49
Thanks: 85
Thanked 0 Times in 0 Posts
|
thanks guys I solved the problem
|
|
“Watch your thoughts, they become words; watch your words, they become actions; watch your actions, they become habits; watch your habits, they become character; watch your character, for it becomes your destiny.” F.O. | |
| |
|
| Bookmarks |
| Tags |
| advice, css |
| |