So, I got my Dopdown for Languages, I want to make a href if I press on "English", how can I do that?
<div class="nav-wrapper">
<div class="sl-nav">
Sprache:
<ul>
<li><b>Deutsch</b> <i class="fa fa-angle-down" aria-hidden="true"></i>
<div class="triangle"></div>
<ul>
<li><i class="sl-flag flag-de"><div id="germany"></div></i> <span class="active">Deutsch</span></li>
<li><i class="sl-flag flag-usa"><div id="germany"></div></i> <span>English</span></li>
<li><i class="sl-flag flag-cz"><div id="germany"></div></i> <span>Česky</span></li>
</ul>
</li>
</ul>
</div>
</div>
Im pretty new, to HTML and don't know where to put my href
You could put the a anchor in the whole li element, so it works by clicking on the text and also the flag:
<li><i class="sl-flag flag-usa"><div id="germany"></div></i> <span>English</span></li>
also, remember to change your ids, they're all germany now
You can add an anchor tag <a> on the elements:
<li><i class="sl-flag flag-usa"><div id="germany"></div></i>English</li>
Related
I'm trying to make the background of my footer dark grey. Here's the HTML:
<footer>
<div class="row">
<div class="col span-1-of-2">
<ul class="footer-nav">
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
</ul>
</div>
<div class="col span-1-of-2">
<ul class="social-links">
<li><i class="ion-social-twitter icon-small"></i></li>
<li><i class="ion-social-facebook icon-small"></i></li>
<li><i class="ion-social-instagram icon-small"></i></li>
<li><i class="ion-social-google icon-small"></i></li>
</ul>
</div>
</div>
</footer>
and here's the CSS:
footer {
background-color: #555;}
I think it's because the information in the two divs is covering up the footer. However, I've tried giving the divs their own class names and using the 'inherit' property and it hasn't worked. If anyone could give me some advice I'd very much appreciate it.
Add an "important" to the rule setting the background-color of the footer and you're set to fly:
<style type="text/css">
footer, footer div {
background-color: #555 !important;
}
</style>
Solution
Hi there! When I put only the code you provide to us in here http://www.play-hookey.com/htmltest/ A grey footer is created. I can only conclude that another command is overriding yours. The easiest way to fix this is by making it important
footer, footer{
background-color: #555 !important;
}
This is however, bad practice, and you should troubleshoot before doing that
Troubleshooting
Try putting your footer styling below all other styling, the browser might be reading something else and overwriting your code
Its not good practice but you could use inline styling
Or you can create a class and apply it to your footer, as those rank above styling the element
I know this might sound silly, but if you are running it on your browser to check, May I suggest deleting your browsing history?
I've had issues in the past which make my head scratch only to realize the solution is solved after I delete my browsing history (mainly the cache).
Unable to comment but I will provide this link where it is working as expected.
footer {
background-color: #555;
}
<footer>
<div class="row">
<div class="col span-1-of-2">
<ul class="footer-nav">
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
<li>XYZ</li>
</ul>
</div>
<div class="col span-1-of-2">
<ul class="social-links">
<li><i class="ion-social-twitter icon-small"></i></li>
<li><i class="ion-social-facebook icon-small"></i></li>
<li><i class="ion-social-instagram icon-small"></i></li>
<li><i class="ion-social-google icon-small"></i></li>
</ul>
</div>
</div>
</footer>
Codepen
I am looking at the code for a gallery page. It is able to filter the type of media displayed (video, image, etc) and as far as I can see, it does this with the data-option-value attribute.
I cannot find any documentation explaining the functionality, application or anything else really about the data-option-value attribute.
Any help in explaining what this attribute is, what it does or how it assists in filtering the displayed media would be helpful.
Here is the code:
<ul class="nav nav-pills sort-source" data-sort-id="gallery" data-option-key="filter">
<li data-option-value="*" class="active"><i class="fa fa-th"></i> <span>Show All</span></li>
<li data-option-value=".images"><span><i class="fa fa-image"></i> Images</span></li>
<li data-option-value=".videos"><span><i class="fa fa-video-camera"></i> Videos</span></li>
<li data-option-value=".links"><span><i class="fa fa-link"></i> Links</span></li>
<li data-option-value=".sliders"><span><i class="fa fa-desktop"></i> Sliders</span></li>
</ul>
Here is one of the code for one of the images in the gallery:
<li class="col-md-3 col-sm-6 col-xs-6 grid-item gallery-grid-item links format-link">
<img src="http://placehold.it/600x400&text=IMAGE+PLACEHOLDER" alt="">
</li>
Anything starting with data-* is a custom HTML attribute that the author added to the HTML element to do something with it in JS.
Example:
<div id="mydiv" data-width="500" data-content="Hello World" data-favoritecolor="green"></div>
In short, you'll have to take a look at the JS, search for getAttribute("data-option-value")
I'm trying to rotate an arrow 90 degrees when I hover over a menu item on my navbar.
The navbar menu when hovered over currently displays a list of sub menus, but I'd like for the arrow to rotate facing down when the submenu is displayed. Submenu hover works as I'd like to right now, but I can only get the arrow to rotate if I hover directly over it. I would like tie the arrow rotation and the submenu display together.
Here's my HTML:
<li>
<a>
<i class="fa fa-columns" aria-hidden="true"></i>
Admin
<i class="fa fa-arrow-right" aria-hidden="true"></i>
</a>
<ul>
<li><i class="fa fa-globe" aria-hidden="true"></i> Source Admin</li>
<li><i class="fa fa-inbox" aria-hidden="true"></i> Service Admin</li>
<li><i class="fa fa-clipboard" aria-hidden="true"></i> Bulk Services</li>
</ul>
</li>
Here is my CSS:
nav li:hover > ul
{
display: block;
}
nav i:hover
{
transform: rotate(90deg);
}
I should also note, that the way I have it right now rotates every other menu icon at the moment.
Any help is appreciated, thank you!
I currently am using CSS columns, to create a 2 column layout for an unordered list. Here's the code:
HTML
<div class="meta-data">
<ul>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Case Study</strong> Case Study Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Sector</strong> Sector Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Client</strong> Client Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Value</strong> Value Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Programme Duration</strong> Programme Duration Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Current Status</strong> Current Status Here </li>
</ul>
</div>
CSS
.meta-data ul {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
}
This works fine. However, if any of the li content wrap onto 2 lines or more, it throws off the 2nd column bullet points so they're not all lined up horizontally...
For example:
Case Studies: This goes onto Value: Value Here
two lines
Programme Duration: Duration here.
Sector: Sector here.
Current Status: Current Status here.
Client: Client Here
This looks messy.
I'd rather it showed as:
Case Studies: This goes onto Value: Value Here
two lines
Sector: Sector here. Programme Duration: Duration here.
Client: Client Here Current Status: Current Status here.
Is this easily possible with the CSS columns setup, or do I need to recode this a diff way?
I don't see a way to do this using column property, you can use css grid
.meta-data ul {
display:grid;
grid-template-columns: 300px 300px;
grid-column-gap:10px;
}
<div class="meta-data">
<ul>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Case Study</strong> Case Study Here Case Study HereCase Study</li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Sector</strong> Sector Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Client</strong> Client Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Value</strong> Value Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Programme Duration</strong> Programme Duration Here </li>
<li><i class="fa fa-chevron-right fa-xs"></i><strong>Current Status</strong> Current Status Here </li>
</ul>
</div>
Im trying to change the nav item in my ASP.Net MVC 4 project. I have found some examples but they dont work with the way the menu in need( See code):
<nav>
<ul>
<li>
<a href="/StartMenu/Index" class="current" title="Dashboard">
<i class="icon-map-marker"></i>
Dashboard
</a>
</li>
<li>
<a href="/StartMenu/Forms" title="Forms Stuff">
<i class="icon-edit"></i>
Forms Stuff
</a>
</li>
If all you're trying to do is make sure the last link that was clicked has class="current" you can do this
$("a").click(function() {
$("a").removeClass("current");
$(this).addClass("current");
})