html <a> not clickable inside menu - html

I have the following menu, the <a>'s are not clickable, i believe it is a z-index problem but haven't been able to fix it. Also does the html make sense, trying to make a circle with a connected rectangle on the right. Then when it drops down it will be fully connected and filled in. I am using bootstrap 2.3.2.
jsfiddle link
html
<div class="row-fluid">
<div class="span2"></div>
<div class="span7 center"></div>
<div class="span3">
<div class="rightMenu visible-desktop">
<div class="scoreBadge">--</div>
<div class="userBadge"> username ▼
</div>
<ul>
<li> settings
</li>
<li> log out
</li>
</ul>
</div>
</div>
</div>
css
.rightMenu{
position: absolute;
right: 0;
top: 8px;
margin-top: 10px;
min-width: 65px;
}
.rightMenu ul {
display: none;
list-style: none;
text-align: left;
position: relative;
left: -10px;
top: -30px;
background-color: #4b86a1;
color: white;
z-index: -2;
margin-left: 10px;
padding: 20px 10px 10px 10px;
}
.rightMenu ul li {
}
.rightMenu:hover ul {
display: block;
}
.rightMenu ul a {
color: white;
}
.scoreBadge {
display: inline-block;
background: white;
color: #4B86A1;
height: 30px;
width: 30px;
border: 2px solid #fcdf05;
border-radius: 50%;
text-align: center;
line-height: 30px;
vertical-align: middle;
font-size: 18px;
}
.userBadge {
display: inline-block;
background-color: #4b86a1;
vertical-align: middle;
padding-left: 10px;
line-height: 30px;
min-width: 49px;
position: relative;
left: -10px;
-webkit-border-top-right-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-bottomright: 8px;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
text-align: right;
z-index: -1;
}
.userBadge > a {
padding: 0 5px 0 5px;
line-height: 25px;
}
#usrName {
color: white;
font-size: 10pt;
font-weight: normal;
text-transform: uppercase;
}

In your css you have
.rightMenu ul {
display: none;
list-style: none;
text-align: left;
position: relative;
left: -10px;
top: -18px;
background-color: #4b86a1;
color: white;
z-index: -2; /* this is the problem */
margin-left: 10px;
padding: 20px 10px 10px 10px;
}
Just remove the - from z-index: -2; and it'll work. Also, without z-index: 2; it seems working fine, so why not just remove the z-index property ? An example here (with z-index:2) and another example (without z-index property).

I solved for you the problem see the change the z-index to 2 in the Class .rightMenu ul

Related

Why does my cursor in css it's not working?

i started to program recently , and i'm trying to do an client are button and it's not working. Maybe some of you can help me
.areacliente {
width: 100px;
height: 100px;
position: absolute;
right: 15px;
top: 13px;
width: 130px;
margin-top: -10px;
text-align: right;
transition: .3s;
cursor: pointer;
}
.btn {
border: 1.2px solid #8e44ad;
border-radius: 8px;
background: none;
padding: 5px 10px;
font-size: 14px;
margin: 5px;
color: #9b59b6;
list-style: none;
}
.btn li a {
text-decoration: none;
cursor: pointer;
}
<div class="areacliente">
<ul class="btn">
<li>Client Area<i id="lock"class="fas fa-user-lock"></i></li>
</ul>
</div>
Your issue is that your nav is floating on top of your 'Client Area' button so you can click on it. To fix this you need to change the z-index of this button:
.areacliente {
position: absolute;
right: 15px;
top: 13px;
width: 130px;
margin-top: -10px;
text-align : right;
transition: .3s;
cursor: pointer;
z-index: 1; /* Add this */
}
This will bring the button above the nav so you can now click on it.
See working example in this fiddle.
.areacliente {
width: 100px;
height: 100px;
position: absolute;
right: 15px;
top: 13px;
margin-top: -10px;
text-align: right;
transition: .3s;
cursor: pointer;
}
.btn {
border: 1.2px solid #8e44ad;
border-radius: 8px;
background: none;
padding: 5px 10px;
font-size: 14px;
margin: 5px;
color: #9b59b6;
list-style: none;
}
.btn li a {
text-decoration: none;
cursor: pointer;
}
<div class="areacliente">
<ul class="btn">
<li>Client Area<i id="lock"class="fas fa-user-lock"></i></li>
</ul>
</div>
I think left side space problem.so width: 100px; only use remove other one width: 130px
.areacliente {
width: 100px;
height: 100px;
position: absolute;
right: 15px;
top: 13px;
width: 130px;
margin-top: -10px;
text-align: right;
transition: .3s;
cursor: pointer;
}

How to hover the complete row in css?

I have a screenshot as shown below which I have replicated in HTML, CSS and JS.
I have created the fiddle for the above screenshot. The above screen-shot portion is at the extreme right in the fiddle. On clicking three dots, the drop-down menu appears.
The HTML and CSS codes which I have used in order to create the drop-down is:
HTML:
<div class="nav-top-searchbar">
<form>
<span class="fa fa-search searchicon fa-lg" aria-hidden="true"></span>
<input type="text" name="search">
<div style="">
<img tabindex="1" src="https://s9.postimg.org/d6s4xvykv/Ellipsis.png" id="ellipsis">
<div class="dropdown">
<li>View Status<i class="fa fa-angle-down" aria-hidden="true"></i></li>
<li>Release Bills</li>
<li>Add Attendee</li>
<li>Export as</li>
<li>View in Google Sheets</li>
<li>Send Notifications</li>
</div>
</div>
</form>
</div>
CSS:
// General CSS
.nav-top-searchbar {
position: relative;
}
#ellipsis {
top: 12px;
position: absolute;
right: 43px;
cursor: pointer;
}
#ellipsis:focus {
outline: none;
}
#ellipsis:focus+.dropdown {
display: block;
}
input[type=text] {
width: 100%;
background: #10314c;
}
.dropdown {
background-color: #FFFFFF;
display: none;
padding-left: 2%;
position: absolute;
/* height: 150px; */
right: 0;
width: 200px;
z-index: 10;
list-style-type: none;
padding-top: 25px;
padding-bottom: 25px;
box-shadow: 0 0 15px #888;
top: 2px;
}
.searchicon {
float: left;
margin-top: -20px;
position: relative;
top: 26px;
left: 8px;
color: white;
border: 1px solid #FFFFFF;
z-index: 2;
padding: 3px;
}
.dropdown a {
color: #676767;
font-weight: bold;
font-size: 14px;
}
.dropdown li:hover {
background-color: #EDEDED;
}
Problem Statement:
In my fiddle, the hover doesn't cover the entire row. It only covers 80% of the row. I am wondering what changes do I need to make in the above CSS codes so that the hover covers the entire row.
You have padding on your dropdown container:
.dropdown{
padding-left: 2%;
}
This space is unusable by the child list items. Put the padding on the list items instead:
.dropdown li{
padding-left: 2%;
}
https://jsfiddle.net/nc2djn5p/94/
This should do the trick: https://jsfiddle.net/hp0hxoL3/
.dropdown {
background-color: #FFFFFF;
display: none;
padding-left: 2%;
position: absolute;
/* height: 150px; */
right: 0;
width: 200px;
z-index: 10;
list-style-type: none;
padding-top:25px;
padding-bottom:25px;
box-shadow: 0 0 15px #888;
top: 2px;
list-style: none;
padding: 0;
margin: 0;
}
.searchicon {
float: left;
margin-top: -20px;
position: relative;
top: 26px;
left: 8px;
color: white;
border: 1px #FFFFFF;
z-index: 2;
}
.dropdown a
{
color: #676767;
font-weight: bold;
font-size: 14px;
}
.dropdown li {
padding: 8px;
}
.dropdown li:hover
{
background-color: #EDEDED;
}
It doesn't match exactly the example, but it's close enough.
Your div class="dropdown" has a left padding of 2%. You will need to set it to 0.
As David said, set the padding in .dropdown li, instead of .dropdown

margin-top is not working

I'm trying to implement a popup at the bottom right corner of my web in WordPress.
The popup is working properly, but I have 2 lines of text, a message and a button. Everything was okay since I wanted to put a margin-top in the button because the button was covering the text.
Here you can see the HTML code and the CSS.
#corner-slider {
position: fixed;
z-index: 10000;
overflow: hidden;
border-radius: 15px;
color: white;
padding: 10px;
margin-bottom: 60px;
height: 120px;
width: 369px;
border: 1px solid #2d93f1;
background: #2d93f1;
}
#corner-slider.hidden {
display: none;
}
#corner-slider .close {
position: absolute;
cursor: pointer;
font-size: 16px;
display: inline-block;
z-index: 1002;
right: 24px;
top: 10px;
}
.popup-button {
padding: 8px 30px;
background-color: #ffffff;
border-color: #ffffff;
border-radius: 45px;
margin-top: 240px;
}
<div id="corner-slider">
Do you want to stay here?
<br />
<a target="_blank" href="#" class="popup-button">Click me!</a>
</div>
So, why is margin-top not working? What can I do?
Thanks.
The anchor element <a> is an inline element. Change its display type to inline-block or block:
#corner-slider {
position: fixed;
z-index: 10000;
overflow: hidden;
border-radius: 15px;
color: white;
padding: 10px;
margin-bottom: 60px;
height: 120px;
width: 369px;
border: 1px solid #2d93f1;
background: #2d93f1;
}
#corner-slider.hidden {
display: none;
}
#corner-slider .close {
position: absolute;
cursor: pointer;
font-size: 16px;
display: inline-block;
z-index: 1002;
right: 24px;
top: 10px;
}
.popup-button {
padding: 8px 30px;
background-color: #ffffff;
border-color: #ffffff;
border-radius: 45px;
display: inline-block;
margin-top: 1em;
}
<div id="corner-slider">
Do you want to stay here?
<br />
<a target="_blank" href="#" class="popup-button">Click me!</a>
</div>
button is not stable, just add disply:inline-block or float:left
#corner-slider {
position: fixed;
z-index: 10000;
overflow: hidden;
border-radius: 15px;
color: white;
padding: 10px;
margin-bottom: 60px;
height: 120px;
width: 369px;
border: 1px solid #2d93f1;
background: #2d93f1;
}
#corner-slider.hidden {
display: none;
}
#corner-slider .close {
position: absolute;
cursor: pointer;
font-size: 16px;
display: inline-block;
z-index: 1002;
right: 24px;
top: 10px;
}
.popup-button {
padding: 8px 30px;
background-color: #ffffff;
border-color: #ffffff;
border-radius: 45px;
margin-top: 10px;
display: inline-block; /* newly added */
}
<div id="corner-slider">
Do you want to stay here?
<br />
<a target="_blank" href="#" class="popup-button">Click me!</a>
</div>
i made some changes in your code just have a look in the below code, just place the text in the div and add a css of margin-bottom:15px;
<style>
#corner-slider {
position:fixed;
z-index:10000;
overflow:hidden;
border-radius: 15px;
color: white;
padding: 10px;
margin-bottom: 60px;
height: 120px;
width:369px;
border:1px solid #2d93f1;
background:#2d93f1;
}
#corner-slider.hidden{
display:none;
}
#corner-slider .close{
position:absolute;
cursor:pointer;
font-size:16px;
display:inline-block;
z-index:1002;
right:24px;
top:10px;
}
.popup-button {
padding: 8px 30px;
background-color: #ffffff;
border-color: #ffffff;
border-radius: 45px;
margin-top: 240px;
}
/*--------------- new css ----------*/
.small-area
{
margin-bottom: 15px;
}
</style>
<div id="corner-slider">
<div class="small-area">Do you want to stay here?</div>
<a target="_blank" href="#" class="popup-button">Click me!</a>
</div>

CSS3 button with two colours

I wanted to ask what is the best way to create such button with css:
I was trying to create such button with divs using float left and right, but when i zoom in and out right side of the button drops down. Is there a better way to achieve this?
fiddle link
<div style="width:270px">
<div class="button">
<div>
<div>text</div>
<div>text</div>
</div>
<div><div></div></div>
</div>
</div>
.button {
height: 80px;
cursor: pointer;
}
.button:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.button > div:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border: 1px solid #008f70;
background-color: #00b48c;
text-align: right;
float: left;
padding: 15px;
width: 165px;
}
.button > div:first-child > div:first-child {
color: #b8e3d6;
font-size: 12pt;
}
.button > div:first-child > div:last-child {
color: #fff;
font-weight: bold;
font-size: 20pt;
}
.button > div:last-child {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
float: right;
margin-right: 9px;
background-color: #008f70;
width: 64px;
height: 81px;
position: relative;
}
All it takes:
button.styled{
color:#fff;
background:#00B48C; /* CHANGE ONLY THIS ONE AND SEE IT HAPPEN ;) */
padding:10px 45px 10px 15px;
border-radius:4px;
/* Do not edit below */
border:0;
position:relative;
overflow:hidden;
box-shadow:inset 0 0 0 1px rgba(0,0,0,0.2);
}
button.styled:after{
background: rgba(0,0,0,0.2);
padding:11px;
content:'\25be'; /* \25bc \25be */
/* Do not edit below */
position:absolute;
right:0;
top:0;
}
<button class="styled">Hello World</button>
For more UTF-8 characters see: https://stackoverflow.com/a/25986009/383904
you can use only one element with pseudo elements :before and :after
button {
border-radius: 4px 0px 0px 4px;
border-width: 1px;
border-color: #008f70;
border-style: solid;
background-color: #00b48c;
text-align: right;
padding: 15px;
width: 165px;
position: relative;
color: white;
}
button:before {
content: '\25BE';
position: absolute;
right: -32px;
z-index: 1;
font-size: 16px;
top: 50%;
color: white;
transform: translatey(-50%);
}
button:after {
content: '';
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
margin-right: 9px;
background-color: #008f70;
width: 54px;
position: absolute;
top: -1px;
left: 100%;
bottom: -1px
}
button:focus {
outline: 0;
box-shadow: none;
}
<button>test</button>
Get rid of the duplicate div with text and add top and bottom padding to the other div with text.
You can use Font Awesome to get the caret sign in the dropdown.
.button {
height: 80px;
cursor: pointer;
}
.button:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.button > div:first-child {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
border: 1px solid #008f70;
background-color: #00b48c;
text-align: right;
float: left;
padding: 22px 15px 26px 15px; /* add top and bottom border */
width: 165px;
}
.button > div:first-child > div:first-child {
color: #b8e3d6;
font-size: 12pt;
}
.button > div:first-child > div:last-child {
color: #fff;
font-weight: bold;
font-size: 20pt;
}
.button > div:last-child {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
float: right;
margin-right: 9px;
background-color: #008f70;
width: 64px;
height: 81px;
position: relative;
}
i{
margin-left: 45%;
margin-top: 45%;
color: white;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<div style="width:270px">
<div class="button">
<div>
<div>text</div>
</div>
<div><div><i class="fa fa-caret-down"></i></div></div> <!-- add the caret -->
</div>
</div>
Updated jsFiddle
Source

Static Map positioning

I need a some help with positioning a static Google Maps map.
There are two problems:
Having the static map on the same level/line as the writing, the writing on the left and the map on the right
Keeping the footer on the bottom of the page
CodePen DEMO
HTML:
<div class="wrapper">
<ul class="nav">
<li class="home">Home
</li>
<li class="location">Location
</li>
<li class="itinerary">Itinerary
</li>
<li class="photos">Howard & Mary
</li>
</ul>
</div>
<h1>Location</h1>
<p class="grid">USS NORTH CAROLINA
<br/>Address: 1 Battleship Rd NE, Wilmington, NC 28401, United States Telephone: + 1 910-251-5797 wesbite: www.battleshipnc.com/
</p>
<div class="map">
<p class="static_map">
<img src="http://maps.googleapis.com/maps/api/staticmap?parameters?key=AIzaSyDM-P7a6oHU7e-guJpKQPADlGPtX1_iPBU&size=400x300&sensor=false&markers=1+Battleship+Rd,+Wilmington,+North+Carolina+28401" alt+ "1 Battleship Rd, Wilmington, North Carolina 28401"/>
</p>
</div>
<script type = "text/javascript" src = "js/jquery.js"></script>
<script type="text/javascript" src="https: //maps.googleapis.com/maps/api/js?key=AIzaSyDM-P7a6oHU7e-guJpKQPADlGPtX1_iPBU&sensor=false"></script>
<footer class="main-footer">
<h1 class="tri">All donations & proceeds will go towards Dare 2 Tri</h1>
</footer>
CSS:
body {
background-image: url("http://i.istockimg.com/file_thumbview_approve/1985611/2/stock-photo-1985611-uss-north-carolina.jpg");
background-repeat: no-repeat;
background-size: cover;
}
h1 {
text-align: center;
color: #0051c2;
font-size: 80px;
}
.grid {
color: #0051c2;
font-size: 40px;
width: 45%;
margin-left: 10px;
}
.map {
margin-right: 10px;
float: right;
}
.wrapper {
position: relative;
top: 10px;
height: 175px;
width: 1100px;
background-color: black;
opacity: 0.8;
margin: auto;
border-radius: 10px;
z-index: 0;
}
.main-footer {
position: absolute;
bottom: 0;
width: 100%;
height: 50px;
background-color: black;
opacity: 0.8;
text-align: center;
}
.tri {
color: white;
font-size: 16px;
}
ul.nav {
display: inline;
color: white;
text-decoration: none;
text-align: center;
padding: 8px 15px;
border-radius: 5px;
text-align: auto;
}
ul.nav li {
float: left;
margin-left: 50px;
}
ul.nav li.home {
padding: 35px 15px;
margin: 20px;
top: 15px;
font-weight: 100;
height: 55px;
width: 130px;
font-size: 40px;
}
ul.nav li.home:hover {
background-color: #0051c2;
border-radius: 8px;
}
ul.nav li.location {
padding: 35px 15px;
margin: 20px;
font-weight: 100;
top: 15px;
height: 55px;
width: 180px;
border-radius: 5px;
font-size: 40px;
}
ul.nav li.location:hover {
background-color: #0051c2;
border-radius: 8px;
}
ul.nav li.itinerary {
padding: 35px 15px;
margin: 20px;
font-weight: 100;
height: 55px;
width: 200px;
border-radius: 5px;
font-size: 40px;
}
ul.nav li.itinerary:hover {
background-color: #0051c2;
border-radius: 8px;
}
ul.nav li.photos {
padding: 35px 15px;
margin: 20px;
margin-left: 20px;
border: 0;
font-weight: 120;
height: 55px;
width: 250px;
border-radius: 5px;
font-size: 40px;
}
ul.nav li.photos:hover {
background-color: #0051c2;
border-radius: 8px;
}
ul.nav li a {
color: #faf3bc;
display: block;
text-decoration: none;
}
First Issue: Aligning address with map
Make your 'grid' p into a div and add float:left to your .grid CSS.
Example: http://codepen.io/anon/pen/kwJcE
Second Issue: Sticky Footer
Duplicate question, see here: Make footer stick to bottom of page correctly
Direct link: "A CSS Sticky Footer that just works"
Bonus Third Issue: Terrible Design
I would never tell anyone they are learning 'wrong' but check out grid systems/frameworks, especially responsive grid systems. It will help you build faster with a better aesthetic.