Positioning sidebar and article below navbar with html and css - html

with this html code:
<header>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</header>
<main>
<nav>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</nav>
<article>
<section>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</section>
<section>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</section>
<section>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</section>
<section>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</section>
<section>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</section>
</article>
</main>
<footer>
<ul>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
<li> ... </li>
</ul>
</footer>
I am trying write a css for acomplish this things:
one fixed navbar on top (already ok)
main area with a sidebar and an "article" area (need fix position and alignment of its parts)
the article area needs to be placed to the roght of the sidebar, but right now it's been displayed on the bottom of it.
footer has some strange banner been displayed below (only when mouse cursor is not hovering it) like it's showing here:
https://jsfiddle.net/klebermo/5axmocwp/1/
Anyone can give some hints of how to fix that?

May be this is what you want? I only change this in css:
main {
margin-top: 32px;
/* below lines was added */
display: flex;
flex-direction: row-reverse;
justify-content: flex-end;
}
footer {
left: 0;
bottom: 0;
width: 100%;
background-color: #333;
color: white;
text-align: center;
/* below line was added */
height: 50px;
}
Here is example. I use flexbox in this solution - great tutorial about this is HERE - however you can also use even better tool for layouts: GRID.
Suggestion: use class attribute in html and then use that class name in css - direct html tag names in css is not good practice - if possible avoid it

Related

put html menu on jsfiddle. unclosed regular expression

I can not run this code. I have unclosed regular expression from what I see all tags are closed correctly. Maybe at the end of the confusion but the system shows an error even at the beginning of the code.
jsfiddle.net/n5u2wwjg/176703/
on codepen its works codepen.io/romanown/pen/PdERze
There are some closing tags missing - Correct your render()
<div>
<ul class="top-menu">
<li>
Главная home page
</li>
<li>
Портфолио
</li>
<li>
<div>
Shops
</div>
<ul class="submenu">
<li> Column 1
<ul>
<li>
Element of list
</li>
<li>
Element of list
</li>
<li>
Элемент списка
</li>
<li>
Элемент списка
</li>
<li>
Элемент списка
</li>
<li>
Элемент списка
</li>
<li>
Элемент списка
</li>
<li>
Элемент списка
</li>
</ul>
</li>
<li>
<ul>
<ul>
<li>
<a href="" class="link-image">
<img src="https://html5book.ru/wp-content/uploads/2017/01/white-lady.jpg" />
</a>
</li>
<li>
<h3 class="image-header">Header of picture</h3>
</li>
</ul>
</ul>
<li>
Блог
</li>
</li>
</ul>
</li>
</ul>
</div>

select last of the Element gg in list of ul li from recursive structure with css

I want to select with css the last of child <li> that text appear gg
I want only select Last gg <li> Please Help
ul {
margin: 0;
padding: 0;
}
.container ul li + li:nth-last-child(1) li:last-child {
border: 1px solid red
}
<div class="container">
<ul class="ng-scope">
<li>
<ul>
<li>a</li>
</ul>
</li>
<li>
aa
<ul>
<li>
bb
<ul>
<li>
cc
<ul>
<li>
dd
<ul>
<li>
ee
<ul>
<li>
ff
<ul>
<li>
gg
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Try this
ul { margin:0; padding:0;}
.gg{
color:red;
}
<div class="container">
<ul class="ng-scope">
<li>
<ul>
<li>a</li>
</ul>
</li>
<li>
aa
<ul>
<li>
bb
<ul>
<li>
cc
<ul>
<li>
dd
<ul>
<li>
ee
<ul>
<li>
ff
<ul>
<li class="gg">
gg
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>

Gap above navigation bar?

Since adding a slide show into my site I now have a odd gap above my navigation bar. I am not sure on how to fix this. I tried what I did last time I had this happening but nothing ...
I have a JSfiddle set up: https://jsfiddle.net/7yj8rkbe/
HTML (for my nav bar):
<img src="img/Logo.png" id="logo">
<li>
Other
<ul>
<li>About</li>
<li>Contact</li>
</ul>
</li>
<li>
Store
<ul>
<li>Official</li>
<li>Community</li>
</ul>
</li>
<li>
Projects
<ul>
<li>Official</li>
<li>Community</li>
<li>Open Source</li>
</ul>
</li>
<li>
Forum
<ul>
<li>Programming</li>
<li>Technology</li>
<li>Gaming</li>
</ul>
</li>
<li>
<a id="nav-home" href="#">Home</a>
</li>
</ul>
#information {
top: 0;
}
You specified fixed positioning to that div but you forgot to set top value.

How to place icon in navigation bar

Hi I have created a navigation bar and I want to place a home image icon at the start of the navigation. However when I try to it either moves the other items down or when I hover over the icon the hover doesn't work properly.
<div id="nav">
<div id="nav_wrapper">
<ul>
<li class="icon-home"></li>
<li id="et"> England
<ul>
<li>Premiership
</li>
<li>Championship
</li>
<li>League 1
</li>
<li>League 2
</li>
</ul>
</li>
<li id="et"> France
<ul>
<li>Ligue 1
</li>
</ul>
</li>
<li id="et"> Germany
<ul>
<li>Bundesliga
</li>
</ul>
</li>
<li id="et"> Italy
<ul>
<li>Serie A
</li>
</ul>
</li>
<li id="et"> Spain
<ul>
<li>La Liga
</li>
</ul>
</li>
</ul>
</div>
<!-- Nav wrapper end -->
</div>
In the link below I managed to get the heading in line however the hover effect doesn't work. http://jsfiddle.net/mxohL7kL/
The home link has no text in it, that is why your hover effect is not the same height as the other link. What you could do is, gives the home anchor a text and hide it.
<!-- HTML -->
<li class="icon-home"><span>Home</span></li>
//css
.icon-home a span {
visibility:hidden;
}
see the example here

how to make a menu highlighted while pointing sub menu?

I am making a menu bar with sub menus. what i need while hovering mouse to menu the sub menu will appear and menu has to be highlighted. Please help me.....
<div class="side-bar">
<ul class="">
<li>Home
</li>
<li>About Us
</li>
<li>Portfolio
<ul>
<li>SELECTED PROJECTS
</li>
<li>program
<!-- i need this to be highlighted while cursoring sub menu -->
<ul>
<li>RESIDENTIAL
</li>
<li>HOSPITALITY
</li>
<li>INSTITUTION &AMP; COMMERCIAL
</li>
<li>INFRASTRUCTURE
</li>
<li>EDUCATIONAL
</li>
<li>COMMUNITY
</li>
<li>HEALTHCARE
</li>
<li>FACTORY
</li>
<li>FARM HOUSES
</li>
<li>PRIVATE RESIDENCES
</li>
<li>INTERIORS
</li>
</ul>
</li>
<li>chronological
</li>
</ul>
</li>
<li>services
</li>
<li>news
</li>
<li>Press
</li>
<li>D [+] DR
</li>
<li>Careers
</li>
<li>Contact Us
</li>
</ul>
</div>
You can simply do that using CSS, so try this:
li:hover > a {
/* Selects all <a> elements that are placed immediately after <li> which is hovered */
color: #FFF; /* or any code you want */
}
So if the mouse is over the li itself it will be highlighted, also if it's over ul or li inside the first li it will be also highlighted
Hope this will help you ..