Hello everyone when i hover the a tag i class dropdown dropmenu won't apear.
I try to change .dropdown by nav tag and it works but it works when i hover on the whole nav.
CSS :
.dropmenu {
display: none;
position: absolute;
text-align: center;
background-color: #fafafa;
margin-top: 20px;
width: 100%;
height: 100%;
}
}
.dropdown :hover: .dropmenu {
display: block;
}
HTML
<header>
<nav>
<div class="navleft"><h1>Morocco.</h1></div>
<div class="navmid">
<ul>
<li>
<div class="dropdown">
Decouvrir le Maroc
</div>
<div class="dropmenu">
<ul>
<li>Histoire</li>
<li>Histoire</li>
<li>Histoire</li>
<li>Histoire</li>
</ul>
</li>
</div>
<li>Destination</li>
<li>Infos Pratique</li>
<li>Nous contacter</li>
</ul>
</div>
<div class="navright">
<img src="/img/menu_FILL0_wght400_GRAD0_opsz48.svg" alt=""/>
</div>
</nav>
</header>
I try to replace .dropmenu by nav tag and it work but it work on the all navbar and not a only
You have errors on CSS and HTML
<header>
<nav>
<div class="navleft"><h1>Morocco.</h1></div>
<div class="navmid">
<ul>
<li>
<div class="dropdown">
Decouvrir le Maroc
</div>
<div class="dropmenu">
<ul>
<li>Histoire</li>
<li>Histoire</li>
<li>Histoire</li>
<li>Histoire</li>
</ul>
</div>
</li>
<li>Destination</li>
<li>Infos Pratique</li>
<li>Nous contacter</li>
</ul>
</div>
<div class="navright">
<img src="/img/menu_FILL0_wght400_GRAD0_opsz48.svg"
alt=""/>
</div>
</nav>
</header>
.dropmenu {
display: none;
position: absolute;
text-align: center;
background-color: #fafafa;
margin-top: 20px;
width: 100%;
height: 100%;
}
.dropdown:hover ~ .dropmenu {
display: block;
}
First: the <div class="dropmenu"> is not closing at the good place
Second: you have an extra bracket that you don't need in your CSS file
Three: the css is not good (the ~ is used to sibling "brothers" element)
I don't know if my english is good enough, but hope it will help you
Related
I am trying to place my social and email links found with a ul additional-menu, to be displayed under my site's logo and tagline. I seem to be struggling getting it underneath. At the moment it looks like this:
The code below is like so:
.additional-menu {
list-style-type:none;;
margin: 0;
position:relative;
clear:both
}
.additional-menu li{
display:inline-block;
}
.ast-header-html-1{
position:relative;
clear:both;
}
<div class="ast-site-title-wrap">
<h1 class="site-title" itemprop="name">
<a href="https://puffpastrydelights.com/" rel="home" itemprop="url">
Pastry Delights
</a>
</h1>
<p class="site-description" itemprop="description">
Made with love, served with pride
</p>
</div>
<div class="ast-builder-layout-element ast-flex site-header-focus-item ast-header-html-1" data-section="section-hb-html-1">
<div class="ast-header-html inner-link-style-">
<div class="ast-builder-html-element">
<ul class="additional-menu">
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</div>
Wrap the whole thing with div that has display:flex and flex-direction: column
.wholeThing {
display: flex;
flex-direction: column;
border: 1px solid red;
}
.firstBit {
display: flex;
border: 1px solid blue;
}
<div class="wholeThing">
<div class="firstBit">
<div class="logo"><img src="http://placekeanu.com/250" /></div>
<div class="tagline">Keanu is breath taking</div>
</div>
<div class="social">
social one two three
</div>
</div>
`
heres the image of the error I tried several methods on how to align the footer at the bottom but I haven't found any solution what method should I use to solve the problem?
<footer>
<div class="container">
<nav class="footer-nav">
<ul>
<li>About us</li>
<li>Contact</li>
</ul>
</nav>
<nav class="footer-nav">
<ul>
<li>
<a href="#" class="social-link">
<img src="/img/iconmonstr-facebook-2.svg" alt="" />
Facebook
</a>
</li>
<li>
<a href="#" class="social-link">
<img src="/img/iconmonstr-instagram-11.svg" />
Instagram
</a>
</li>
</ul>
</nav>
</div>
</footer>
Add style to the footer element:
style="position:absolute; bottom:0px"
You can use position: absolute as recommended by avi,
But I generally recommend against absolute where possible.
This can be also solved using flexbox.
set the flex-direction to column,
and set flex: 1 on the main part which you want to take all space (generally you don't want the header and footer to expand)
html, body {
height: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
}
header {
background-color: red;
}
main {
flex: 1;
background-color: green;
}
footer {
background-color: blue;
}
<header>Header<</header>
<main>Main</main>
<footer>Footer</footer>
NOTE: you must set the body and html height to 100% in order for that to work.
https://jsfiddle.net/jszht5xp/19/
Here are my CSS and HTML codes respectively :
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #55AAFF;
}
li {
float: left;
}
li a {
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #1D72C7;
}
.indextext
{
font-family: roboto, arial, calibri, sans-serif;
text-align: center;
padding: 50px 150px 0px 150px;
}
<html>
<head>
<title>Welcome - Bookmark Designs - Web Design Solutions</title>
<link href="C:\Users\Raj\Desktop\New folder\homepage_css.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="logoimg">
<img src="" </img>
</div>
<div class="nav"
<ul>
<li id=1>Home</li>
<li id=2>Portfolio</li>
<li id=3>Prices</li>
<li id=4>Contact Us</li>
<li id=5>About Us</li>
</ul>
</div>
<div class="mainimg">
<img src="" />
</div>
<div class="indextext">
<p>TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText</p>
</div>
I've provided a link to the output below. Also, how do I stop those bullet points from appearing?
I've tried long and hard and racked my limited knowledge to what may be causing this and did a lot of trial and error but most things I tried kept worsening things.
Thank you very much.
<div class="logoimg">
<img src="">
</div>
<div class="nav">
<ul>
<li id=1>Home</li>
<li id=2>Portfolio</li>
<li id=3>Prices</li>
<li id=4>Contact Us</li>
<li id=5>About Us</li>
</ul>
</div>
<div class="mainimg">
<img src="">
</div>
<div class="indextext">
<p>TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText</p>
</div>
img tags don't have closing </img>
You were missing a closing > on a div
Put your id attribute values inside quotes
Fiddle: https://jsfiddle.net/zhtq9jn9/1/
My original FlexSlider markup:
<div id="flex" class="flexslider">
<ol class="flex-control-nav flex-control-paging"><li><a class="flex-active">1</a></li><li><a class="">2</a></li><li><a class="">3</a></li><li><a class="">4</a></li></ol>
<ul class="slides">
<li>
<img src="assets/img/bg-1.jpg" alt="">
</li>
<li>
<img src="assets/img/bg-1.jpg" alt="">
</li>
<li>
<img src="assets/img/bg-1.jpg" alt="">
</li>
</ul>
</div>
My Current FlexSlider markup:
<div id="flex" class="flexslider">
<ol class="flex-control-nav flex-control-paging"><li><a class="flex-active">1</a></li><li><a class="">2</a></li><li><a class="">3</a></li><li><a class="">4</a></li></ol>
<ul class="slides">
<li>
<div class="slider-content">
<h2>Welcome Jack</h2>
<p>This is a numch of dummy text jusrt to take up some space s o that I can see how it will ook like with all these characters being taken up in the world of the of uds this is a nothis is a noahtest test I hope that I can do this as possible.</p>
</div>
<img src="assets/img/bg-1.jpg" alt="">
</li>
<li>
<div class="slider-content">
<h2>Welcome Bob</h2>
<p>This is a numch of dummy text jusrt to take up some space s o that I can see how it will ook like with all these characters being taken up in the world uds this is a nothis is a noahtest test I hope that I can do this as possible.</p>
</div>
<img src="assets/img/bg-1.jpg" alt="">
</li>
<li>
<div class="slider-content">
<h2>Welcome Dan</h2>
<p>This is a numch of dummy text jusrt to take up some space s o that I can see how it will ook like with all these characters being taken up in the world of uds this is a nothis is a noahtest test I hope that I can do this as possible.</p>
</div>
<img src="assets/img/bg-1.jpg" alt="">
</li>
</ul>
</div>
as you can see I added this before the images:
<div class="slider-content">
<h2>Welcome Jack</h2>
<p>This is a numch of dummy text jusrt to take up some space s o that I can see how it will ook like with all these characters being taken up in the world of the of uds this is a nothis is a noahtest test I hope that I can do this as possible.</p>
</div>
Now the problem is that I can only get it to where I want it within the slide if I position .slider-content absolute because if I do not I get the slider-content on top of the slider with a huge margin above it. But if I posistion it absolute it does not work within the sliders. The slider-content will not change along with the slides it will just sit ontop of them. So then I tried positioning it relative and I managed to get it where I want to to be with left: 600px; top: 300px; but then the huge margin on top of the slider where the .slider-content should have been still remains there. And it is not a real "Margin" it's as if its part of the <li>'s height. Hope this makes sense but to sum it all up I just want to be able to add content within my sliders.
This should work for you, it adds a title to the slider.
var $flexslider = $('.flexslider');
$flexslider.flexslider({
animation: "slide",
manualControls: ".flex-control-nav li",
useCSS: false /* Chrome fix*/
});
.flexslider, .flexslider-controls {
max-width: 800px;
}
.slide_text {
background-color: transparent;
background-color: rgba(0, 0, 0, 0.5); /* FF3+, Saf3+, Opera 10.10+, Chrome, IE9 */
bottom: 0;
color: #fff;
display: block;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000); /* IE6–IE9 */
left: 0;
padding: 1em;
position: absolute;
width: 100%;
zoom: 1;
}
.slide_title {
font-size: 1.2em;
text-transform: uppercase;
}
.slide_byline {
font-size: 0.8em;
display: block;
}
.flex-control-nav li {
background: #000;
border-right: solid #fff 1px;
color: #fff;
cursor: pointer;
float: left;
margin: 0.09em 0 0 0;
padding: 1em 1.5em;
vertical-align: middle;
width: 25%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.flex-control-nav li:last-child {
border: none;
}
.flex-control-nav .flex-active {
background: #ccc;
color: #000;
}
/* Minified FlexSlider CSS with Chrome fix */
.flex-container a:active,.flexslider a:active,.flex-container a:focus,.flexslider a:focus{outline:0}.slides,.flex-control-nav,.flex-direction-nav{margin:0;padding:0;list-style:none}.flexslider{margin:0;padding:0}.flexslider .slides>li{display:none;/*-webkit-backface-visibility:hidden;*/position:relative}.flexslider .slides img{width:100%;display:block}.flex-pauseplay span{text-transform:capitalize}.slides:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}html[xmlns] .slides{display:block}* html .slides{height:1%}.no-js .slides>li:first-child{display:block}.flexslider{background:#fff;position:relative;zoom:1}.flex-viewport{max-height:2000px;-webkit-transition:all 1s ease;-moz-transition:all 1s ease;transition:all 1s ease}.loading .flex-viewport{max-height:300px}.flexslider .slides{zoom:1}.carousel li{margin-right:5px}.flex-direction-nav{*height:0}.flex-direction-nav a{width:30px;height:30px;margin:-20px 0 0;display:block;background-position: 0 0;background-repeat: no-repeat;position:absolute;top:50%;z-index:10;cursor:pointer;text-indent:-9999px;opacity:0;-webkit-transition:all .3s ease}.flex-direction-nav .flex-next{background-position:100% 0;right:-36px}.flex-direction-nav .flex-prev{left:-36px}.flexslider:hover .flex-next{opacity:.8;right:5px}.flexslider:hover .flex-prev{opacity:.8;left:5px}.flexslider:hover .flex-next:hover,.flexslider:hover .flex-prev:hover{opacity:1}.flex-direction-nav .flex-disabled{opacity:.3!important;filter:alpha(opacity=30);cursor:default}.flex-control-nav{width:100%;text-align:center}.flex-control-nav li{zoom:1;*display:inline}.flex-control-paging li a{width:11px;height:11px;display:block;background:#666;background:rgba(0,0,0,0.5);cursor:pointer;text-indent:-9999px;-webkit-border-radius:20px;-moz-border-radius:20px;-o-border-radius:20px;border-radius:20px;box-shadow:inset 0 0 3px rgba(0,0,0,0.3)}.flex-control-paging li a:hover{background:#333;background:rgba(0,0,0,0.7)}.flex-control-paging li a.flex-active{background:#000;background:rgba(0,0,0,0.9);cursor:default}.flex-control-thumbs{margin:5px 0 0;position:static;overflow:hidden}.flex-control-thumbs li{width:25%;float:left;margin:0}.flex-control-thumbs img{width:100%;display:block;opacity:.7;cursor:pointer}.flex-control-thumbs img:hover{opacity:1}.flex-control-thumbs .flex-active{opacity:1;cursor:default}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="flexslider">
<ul class="slides">
<li>
<img src="http://flexslider.woothemes.com/images/kitchen_adventurer_cheesecake_brownie.jpg" width="800" height="504" alt="" />
<div class="slide_text">
<div class="slide_title">Title of Slide 1</div>
<div class="slide_byline">Teaser text for slide 1</div>
</div>
</li>
<li>
<img src="http://flexslider.woothemes.com/images/kitchen_adventurer_lemon.jpg" width="800" height="504" alt="" />
<div class="slide_text">
<div class="slide_title">Title of Slide 2</div>
<div class="slide_byline">Teaser text for slide 2</div>
</div>
</li>
<li>
<img src="http://flexslider.woothemes.com/images/kitchen_adventurer_donut.jpg" width="800" height="504" alt="" />
<div class="slide_text">
<div class="slide_title">Title of Slide 3</div>
<div class="slide_byline">Teaser text for slide 3</div>
</div>
</li>
<li>
<img src="http://flexslider.woothemes.com/images/kitchen_adventurer_caramel.jpg" width="800" height="504" alt="" />
<div class="slide_text">
<div class="slide_title">Title of Slide 4</div>
<div class="slide_byline">Teaser text for slide 4</div>
</div>
</li>
</ul>
</div>
<div class="flexslider-controls">
<ol class="flex-control-nav">
<li>Slide 1 Control</li>
<li>Slide 2 Control</li>
<li>Slide 3 Control</li>
<li>Slide 4 Control</li>
</ol>
</div>
I am trying to make my list items all the same width. I've tried setting the widths in the css and nothing changes. Can anyone figure this out?
Here is an image to show what I am talking about:
HTML:
<body>
<div class="content-wrapper" id="container">
<header>logo
<nav>navigation</nav>
</header>
<div class="clear-fix"></div>
<div id="body">
<section class="main-content">
<section class="leftPane">
<h2>Categories</h2>
</section>
<section class="rightPane">
<div class="checkout">
<h1>Checkout</h1>
<ul class="steps">
<li><a href="http://localhost:59213/Cart">
<div id="step0" class="arrow_box_grey">
Shopping Cart</div>
</a>
</li>
<li><a href="http://localhost:59213/Cart/Student">
<div id="step1" class="arrow_box_grey">
Student</div>
</a>
</li>
<li><a href="http://localhost:59213/Cart/Delivery">
<div id="step2" class="arrow_box_grey">
Delivery</div>
</a>
</li>
<li>
<div id="step3" class="arrow_box_green">Payment</div>
</li>
<li>
<div id="step4" class="arrow_box_blue">Finish</div>
</li>
</ul>
</div>
</section>
<div class="clear-fix"></div>
</section>
</div>
</div>
And here if my fiddle with the code: http://jsfiddle.net/M74Em/
You need to change this style:
.main-content .checkout ul.steps li div {
display: inline;
width: 1000px;
}
You can't set widths for inline elements so try this:
.main-content .checkout ul.steps li div {
display: inline-block;
width: 100px;
}
Example
From twBootstrap, applied to <ul>'s (demo):
.ul-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.ul-justified > li {
display: table-cell;
float: none;
width: 1%;
}
and slap .ul-justified to any ul-list you want aligned, and you get equal width <li>'s automatically fit parent ul's width.