I have this rather odd request, and its got me a little baffled.
Essentially I have something like this:
01
A Title
a item
another item
So when the number or the Title gets hovered on. 01 become's white A title becomes red and the list items become white.
Now I know you can do something like
.number:hover .title{
}
But not to sure how to go about this.
<div class="row we-below">
<div class="col-md-3">
<p class="below-num">01</p>
<h4 class="below-title">CONTENT</h4>
<ul>
<li>Research</li>
<li>Strategy</li>
<li>Copywriting</li>
<li>Custom content</li>
<li>Content planning</li>
<li>Campaign framework</li>
<li>Consulting</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">02</p>
<h4 class="below-title">DESIGN</h4>
<ul>
<li>Art Direction</li>
<li>Digital Assets</li>
<li>Animation</li>
<li>Photography</li>
<li>Videography</li>
<li>Graphic Design</li>
<li>Packaging proposals</li>
<li>Studio Recording</li>
<li>Illustration</li>
<li>Branding</li>
<li>Iconography</li>
<li>Website Design</li>
<li>Social Media</li>
<li>Activations</li>
<li>Campaign Strategy</li>
<li>UI Design</li>
<li>UX Design</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">03</p>
<h4 class="below-title">BUILD</h4>
<ul>
<li>App Creation</li>
<li>Packaging</li>
<li>Prototyping</li>
<li>Digital Production</li>
<li>Graphic Assets</li>
<li>Layout & Design</li>
<li>Google Adwords</li>
<li>Style Guides</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">04</p>
<h4 class="below-title">EXECUTION</h4>
<ul>
<li>Media buying</li>
<li>Media planning</li>
<li>Scheduling</li>
<li>Community management</li>
<li>Website Maintenance</li>
<li>Public Relations</li>
<li>Project Management</li>
<li>Corporate Identity Document</li>
</ul>
</div>
</div>
The Desired effect for the on hover
Any Advice or tips would be appreciated. I'd like to learn how to achieve this properly thus the qeustion
you can use sibling css selector
.below-num:hover {
color: white;
}
.below-num:hover + .below-title {
color: red;
}
Try this way
.below-num:hover ~ .below-title {
color: red;
}
.below-num:hover ~ ul li {
color: white;
}
* {
background: black;
color: white;
}
li {
color: gray;
}
.below-num:hover ~ .below-title {
color: red;
}
.below-num:hover ~ ul li {
color: white;
}
<div class="row we-below">
<div class="col-md-3">
<p class="below-num">01</p>
<h4 class="below-title">CONTENT</h4>
<ul>
<li>Research</li>
<li>Strategy</li>
<li>Copywriting</li>
<li>Custom content</li>
<li>Content planning</li>
<li>Campaign framework</li>
<li>Consulting</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">02</p>
<h4 class="below-title">DESIGN</h4>
<ul>
<li>Art Direction</li>
<li>Digital Assets</li>
<li>Animation</li>
<li>Photography</li>
<li>Videography</li>
<li>Graphic Design</li>
<li>Packaging proposals</li>
<li>Studio Recording</li>
<li>Illustration</li>
<li>Branding</li>
<li>Iconography</li>
<li>Website Design</li>
<li>Social Media</li>
<li>Activations</li>
<li>Campaign Strategy</li>
<li>UI Design</li>
<li>UX Design</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">03</p>
<h4 class="below-title">BUILD</h4>
<ul>
<li>App Creation</li>
<li>Packaging</li>
<li>Prototyping</li>
<li>Digital Production</li>
<li>Graphic Assets</li>
<li>Layout & Design</li>
<li>Google Adwords</li>
<li>Style Guides</li>
</ul>
</div>
<div class="col-md-3">
<p class="below-num">04</p>
<h4 class="below-title">EXECUTION</h4>
<ul>
<li>Media buying</li>
<li>Media planning</li>
<li>Scheduling</li>
<li>Community management</li>
<li>Website Maintenance</li>
<li>Public Relations</li>
<li>Project Management</li>
<li>Corporate Identity Document</li>
</ul>
</div>
</div>
Ok i think i can help:
You will need this in your css:
The first is just what it always will be.
.number .title{
some style
}
The second is is for if you hover on it.
.number:hover .title{
}
If this isn't what you want please clarify i litle bit better.
Related
I am trying to write a HTML documentation for my team project. When I was trying to create a navigation menu with nested structure, the second degree doesn't show any content. Can I get some suggestion on possible cause of my problem?
<section class="contents">
<h1 id="contents">Contents</h1>
<ul id="menu">
<li>Problem Statement and Project Overview
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</li>
<li>Use Case</li>
<li>Development Timeline</li>
<li>Technology </li>
<li>Data Sources</li>
<li>Team Capabilities</li>
<li>User Interface</li>
</ul>
</section>
You just need to put some content between your a tags
<section class="contents">
<h1 id="contents">Contents</h1>
<ul id="menu">
<li>Problem Statement and Project Overview
<ul>
<li>overview</li>
<li>background</li>
<li>problem</li>
<li>solution</li>
</ul>
</li>
<li>Use Case</li>
<li>Development Timeline</li>
<li>Technology </li>
<li>Data Sources</li>
<li>Team Capabilities</li>
<li>User Interface</li>
</ul>
</section>
I have been struggling with HTML and CSS and i am trying to get the list in my drop down to display side by side, inline and center? Once i have figured out the correct method i will use the div with the class names "left", "middle" and "right" on all the drop down menus.
here is a pic of what i have got to:
So like you can see in the bath dropdown in the image above i have them in 3 columns they are not inline and there is a gap either side i cannot seem to remove? eventually i will have an extra column on each dropdown which will have a image in it.
Any help would be great and as with all my questions so far a brief description of why would be awesome just so i can get a better understanding as i am learning as i go.
here is a fiddle
https://jsfiddle.net/qesmow58/5/
.header-menu-wrap {
display: inline-block;
width: 100%;
text-align: center;
}
.headermenu {
padding: 0 10% 0 10%;
height: 30px;
background-color: #17D8C7;
}
.headermenu a {
text-decoration: none;
}
.headermenu>ul>li>a {
display: inline-block;
text-align: center;
text-decoration: none;
color: white;
}
.headermenu ul {
padding-left: 0;
list-style: none;
}
.headermenu .arrow {
line-height: 0%;
font-size: 8px
}
.headermenu>ul>li {
position: relative;
display: inline-block;
vertical-align: top;
margin-left: 0.5%;
margin-right: 0.5%;
line-height: 30px;
}
.headermenu>ul>li>div {
display: none;
position: absolute;
top: 100%;
border: 1px solid #aa2ebf;
background-color: white;
width: 450px;
}
.headermenu>ul>li:hover>div {
display: block;
}
.left,
.middle,
.right {
display: inline-block;
}
<div class="header-menu-wrap">
<nav class="headermenu">
<ul>
<li>Home</li>
<li>ON SALE</li>
<li>Suites</li>
<li>Baths<span class="arrow">▼</span>
<div>
<div class="left">
<ul class="bathdropdown1">
<li>
<h3>Bath Types</h3>
</li>
<li>Standard</li>
<li>L-Shaped</li>
<li>B-Shaped</li>
</ul>
</div>
<div class="middle">
<ul class="bathdropdown2">
<li>
<h3>Bath Accessories</h3>
</li>
<li>Bath Screens</li>
<li>Bath Panels</li>
</ul>
</div>
<div class="right">
<ul class="bathdropdown3">
<li>
<h3>All Baths</h3>
</li>
<li>All</li>
</ul>
</div>
</div>
</li>
<li>Toilets<span class="arrow">▼</span>
<div>
<ul class="toiletdropdown1">
<li>
<h3>Toilet Style</h3>
</li>
<li>Back to Wall</li>
<li>Close Coupled</li>
<li>Comfort Height</li>
<li>Fully Back to Wall</li>
<li>Low Level</li>
<li>Toilet and Basin Units</li>
</ul>
<ul class="toiletdropdown2">
<li>
<h3>Toilet Accessories</h3>
</li>
<li>Concealed Cisterns</li>
</ul>
<ul class="toiletdropdown3">
<li>
<h3>All Toilet Types</h3>
</li>
<li>All</li>
</ul>
</div>
</li>
<li>Basins<span class="arrow">▼</span>
<div>
<ul class="basindropdown1">
<li>
<h3>Style</h3>
</li>
<li>Basin and Pedestal</li>
<li>Cloakroom</li>
</ul>
<ul class="basindropdown2">
<li>
<h3>All Basins</h3>
</li>
<li>All Basins</li>
</ul>
</div>
</li>
<li>Shower Enclosures<span class="arrow">▼</span>
<div>
<ul class="showerenclosuredropdown1">
<li>
<h3>Amelia Enclosures
<h3>
</li>
<li>Amelia Bifold Door</li>
<li>Amelia Enclosure Side Panels</li>
<li>Amelia Pivot Door</li>
<li>Amelia Quadrant Enclosure</li>
<li>Amelia Sliding Door</li>
</ul>
<ul class="showerenclosuredropdown2">
<li>
<h3>Sienna Enclosures</h3>
</li>
<li>Sienna Quadrant</li>
<li>Sienna Bifold Door</li>
<li>Sienna Pivot Door</li>
<li>Sienna Sliding Door</li>
<li>Sienna Wet Room Screen</li>
<li>Sienna Enclosure Side Panels</li>
</ul>
<ul class="showerenclosuredropdown3">
<li>
<h3>Show Trays</h3>
</li>
<li>Shower Trays</li>
<li>Riser Kits</li>
</ul>
</div>
</li>
<li>Furniture<span class="arrow">▼</span>
<div>
<ul class="furnituredropdown1">
<li>
<h3>Collection</h3>
</li>
<li>Bella Collection</li>
<li>Caprice Collection</li>
<li>Gino Collection</li>
<li>Shine Collection</li>
<li>Sienna Collection</li>
<li>Valentino Collection</li>
</ul>
<ul class="furnituredropdown2">
<li>
<h3>Unit Type</h3>
</li>
<li>Vanity Unit and Basin</li>
<li>Wall Vanity Unit and Basin</li>
<li>Corner Vanity Unit and Basin</li>
<li>Back to Wall Units</li>
<li>Cupboard Units</li>
<li>Mini Units</li>
</ul>
</div>
</li>
<li>Showers<span class="arrow">▼</span>
<div>
<ul class="showersdropdown1">
<li>
<h3>Style</h3>
</li>
<li>Round Head</li>
<li>Square Head</li>
</ul>
</div>
</li>
<li>Taps<span class="arrow">▼</span>
<div>
<ul class="tapsdropdown1">
<li>
<h3>Bathroom Taps</h3>
</li>
<li>Mono Mixer</li>
<li>Bath Shower Mixer</li>
<li>Mini Mono Mixer</li>
<li>Bath Filler</li>
</ul>
<ul class="tapsdropdown2">
<li>
<h3>Kitchen Taps</h3>
</li>
<li>All</li>
</ul>
<ul class="tapsdropdown3">
<li>
<h3>All Taps</h3>
</li>
<li>All</li>
</ul>
</div>
</li>
<li>Accessories<span class="arrow">▼</span>
<div>
<ul class="accessoriesdropdown1">
<li>Wastes</li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
Add this to your css
.left, .middle, .right {
float: left;
width: 33.3%;
box-sizing: border-box;
}
https://jsfiddle.net/qesmow58/8/
Give the div a class which you have used to wrap drop-down items so that you can be specific for that particular div. Here i have given sub-menu-container class to it
Add vertical-align: top to .left, .middle, .right. this is
because you have set display: inline-block to them.
.header-menu-wrap {
display: inline-block;
width: 100%;
text-align: center;
}
.headermenu {
padding: 0 10% 0 10%;
height: 30px;
background-color: #17D8C7;
}
.headermenu a {
text-decoration: none;
}
.headermenu > ul > li > a {
display: inline-block;
text-align: center;
text-decoration: none;
color: white;
}
.headermenu ul {
padding-left: 0;
list-style: none;
}
.headermenu .arrow {
line-height: 0%;
font-size: 8px
}
.headermenu > ul > li {
position: relative;
display: inline-block;
vertical-align: top;
margin-left: 0.5%;
margin-right: 0.5%;
line-height: 30px;
}
.headermenu > ul > li > div.sub-menu-container {
display: none;
position: absolute;
top: 100%;
border: 1px solid #aa2ebf;
background-color: white;
width: 450px;
}
.headermenu > ul > li:hover > div {
display: block;
}
.left, .middle, .right {
display: inline-block;
vertical-align: top;
}
<div class="header-menu-wrap">
<nav class="headermenu">
<ul>
<li>Home</li>
<li>ON SALE</li>
<li>Suites</li>
<li>
Baths<span class="arrow">▼</span>
<div class="sub-menu-container">
<div class="left">
<ul class="bathdropdown1">
<li>
<h3>Bath Types</h3>
</li>
<li>Standard</li>
<li>L-Shaped</li>
<li>B-Shaped</li>
</ul>
</div>
<div class="middle">
<ul class="bathdropdown2">
<li>
<h3>Bath Accessories</h3>
</li>
<li>Bath Screens</li>
<li>Bath Panels</li>
</ul>
</div>
<div class="right">
<ul class="bathdropdown3">
<li>
<h3>All Baths</h3>
</li>
<li>All</li>
</ul>
</div>
</div>
</li>
<li>
Toilets<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="toiletdropdown1">
<li>
<h3>Toilet Style</h3>
</li>
<li>Back to Wall</li>
<li>Close Coupled</li>
<li>Comfort Height</li>
<li>Fully Back to Wall</li>
<li>Low Level</li>
<li>Toilet and Basin Units</li>
</ul>
<ul class="toiletdropdown2">
<li>
<h3>Toilet Accessories</h3>
</li>
<li>Concealed Cisterns</li>
</ul>
<ul class="toiletdropdown3">
<li>
<h3>All Toilet Types</h3>
</li>
<li>All</li>
</ul>
</div>
</li>
<li>
Basins<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="basindropdown1">
<li>
<h3>Style</h3>
</li>
<li>Basin and Pedestal</li>
<li>Cloakroom</li>
</ul>
<ul class="basindropdown2">
<li>
<h3>All Basins</h3>
</li>
<li>All Basins</li>
</ul>
</div>
</li>
<li>
Shower Enclosures<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="showerenclosuredropdown1">
<li>
<h3>Amelia Enclosures</h3>
</li>
<li>Amelia Bifold Door</li>
<li>Amelia Enclosure Side Panels</li>
<li>Amelia Pivot Door</li>
<li>Amelia Quadrant Enclosure</li>
<li>Amelia Sliding Door</li>
</ul>
<ul class="showerenclosuredropdown2">
<li>
<h3>Sienna Enclosures</h3>
</li>
<li>Sienna Quadrant</li>
<li>Sienna Bifold Door</li>
<li>Sienna Pivot Door</li>
<li>Sienna Sliding Door</li>
<li>Sienna Wet Room Screen</li>
<li>Sienna Enclosure Side Panels</li>
</ul>
<ul class="showerenclosuredropdown3">
<li>
<h3>Show Trays</h3>
</li>
<li>Shower Trays</li>
<li>Riser Kits</li>
</ul>
</div>
</li>
<li>
Furniture<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="furnituredropdown1">
<li>
<h3>Collection</h3>
</li>
<li>Bella Collection</li>
<li>Caprice Collection</li>
<li>Gino Collection</li>
<li>Shine Collection</li>
<li>Sienna Collection</li>
<li>Valentino Collection</li>
</ul>
<ul class="furnituredropdown2">
<li>
<h3>Unit Type</h3>
</li>
<li>Vanity Unit and Basin</li>
<li>Wall Vanity Unit and Basin</li>
<li>Corner Vanity Unit and Basin</li>
<li>Back to Wall Units</li>
<li>Cupboard Units</li>
<li>Mini Units</li>
</ul>
</div>
</li>
<li>
Showers<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="showersdropdown1">
<li>
<h3>Style</h3>
</li>
<li>Round Head</li>
<li>Square Head</li>
</ul>
</div>
</li>
<li>
Taps<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="tapsdropdown1">
<li>
<h3>Bathroom Taps</h3>
</li>
<li>Mono Mixer</li>
<li>Bath Shower Mixer</li>
<li>Mini Mono Mixer</li>
<li>Bath Filler</li>
</ul>
<ul class="tapsdropdown2">
<li>
<h3>Kitchen Taps</h3>
</li>
<li>All</li>
</ul>
<ul class="tapsdropdown3">
<li>
<h3>All Taps</h3>
</li>
<li>All</li>
</ul>
</div>
</li>
<li>
Accessories<span class="arrow">▼</span>
<div class="sub-menu-container">
<ul class="accessoriesdropdown1">
<li>Wastes</li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
Working fiddle here
:not( .banner-nav-not ) .banner-nav a{
color: red;
}
<div class="banner-nav clearfix">
<ul>
<li><a class="banner-nav-not" href="#">how we can help? <span>what we offer</span></a></li>
<li>mobile technologies</li>
<li>corporate training</li>
<li>online marketing</li>
<li>graphic design</li>
</ul>
</div>
I want to select every "a" tag except class".banner-nav-not".
its a wrong order .change that .banner-nav a:not( .banner-nav-not )
.banner-nav a:not( .banner-nav-not ) {
color: red;
}
<div class="banner-nav clearfix">
<ul>
<li><a class="banner-nav-not" href="#">how we can help? <span>what we offer</span></a></li>
<li>mobile technologies</li>
<li>corporate training</li>
<li>online marketing</li>
<li>graphic design</li>
</ul>
</div>
I have the code below for a sidenav, how do i make it display 5 list items at a time so the user has to scroll to see more?
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation" style="float:left">
<div class="well sidebar-nav">
<ul class="nav">
<li><strong>Select a subject</strong></li>
<li class="active">Maths</li>
<li>English</li>
<li>Art and Design</li>
<li>Drama</li>
<li>Music</li>
<li>Physics</li>
<li>Chemistry</li>
<li>Biology</li>
<li>Home economics</li>
<li>Physical Education</li>
<li>Computing Science</li>
<li>French</li>
<li>German</li>
<li>Mandarin</li>
<li>Religious Education</li>
<li>Modern Studies</li>
<li>Geography</li>
<li>History</li>
<li>Creative computing</li>
<li>Craft, Design and Technology</li>
</ul>
</div><!--/.well -->
</div><!--/span-->
</div><!--/row-->
Hi Im new to PureCss of Yahoo. Im trying to make a vertical navigation with collapsible items
im wondering why ul in a li doesn't shows any display. No other css. PureCss of Yahoo only.
this is my code:
<div class="pure-u" id="nav">
Menu
<div class="nav-inner">
<div class="pure-menu pure-menu-open">
<ul>
<li>Dashboard</li>
<li>
Sales
<ul> <!-- this doesn't show :( -->
<li>Create Order</li>
<li>Orders</li>
<li>Sales Report</li>
</ul>
</li>
<li>Purchasing</li>
<li>Reports</li>
<li>Users</li>
<li>Help</li>
<li>Settings</li>
</ul>
</div>
</div>
</div>
As i Understood by the documentation you need add pure-menu-open to any menu that you want to show, and some other classes to make it look decent, this is anyways what i came up with.
<div class="pure-u" id="nav">
Menu
<div class="nav-inner">
<div class="pure-menu pure-menu-open">
<ul>
<li>Dashboard</li>
<li class="pure-menu pure-menu-open pure-menu-can-have-children pure-menu-has-children">
Sales
<ul> <!-- this doesn't show :( -->
<li>Create Order</li>
<li>Orders</li>
<li>Sales Report</li>
</ul>
</li>
<li>Purchasing</li>
<li>Reports</li>
<li>Users</li>
<li>Help</li>
<li>Settings</li>
</ul>
</div>
</div>
</div>
You can see a live version here http://jsfiddle.net/p4hus/