CSS underline with same with as above element - html

I am trying to create the following look:
As you can see on this picture even if there is some padding on the "sub" menu item the border still works.
So here is what I've attempted:
.menu-ul {
list-style-type: none;
}
.menu-li {
padding: 10px 0;
border-bottom: 1px solid rgba(50, 50, 50, 0.3);
width: 100%;
}
a {
font-family: Titillium Web;
font-style: normal;
font-weight: 600;
font-size: 16px;
line-height: 24px;
letter-spacing: 0.02em;
color: #323232;
text-decoration: none;
}
a:hover {
color: #DB091C;
}
.sub-menu-ul {
padding: 0px;
list-style-type: none;
border-top: 1px solid rgba(50, 50, 50, 0.3);
}
.sub-menu-li {
padding: 10px;
width: calc(100% - 20px);
border-top: 1px solid rgba(50, 50, 50, 0.3);
}
hr.solid {
border-top: 3px solid #bbb;
}
<link href="https://pro.fontawesome.com/releases/v5.14.0/css/all.css" rel="stylesheet"/>
<nav style="width: 300px">
<ul class="menu-ul">
<li class="menu-li">
<a href="" >Title </a>
<span style="float: right"><i class="fa fa-angle-down"></i></span>
<div style="display: block">
<ul class="sub-menu-ul">
<li class="sub-menu-li"> <a href="#">
Sub menu item2
</a>
<span style="float: right"><i class="fa fa-angle-right"></i></span>
</li>
</li>
<li class="sub-menu-li"> <a href="#">
Sub menu item2
</a>
</li>
</ul>
</div>
</li>
<li class="menu-li"><a href="" >Title 2</a>
</li>
<li class="menu-li"><a href="" >Title 2</a> </li>
</ul>
</nav>
But I can't seem to get the border right.

Try this, I have changed the padding for menu-li and width of sub-menu-li
.menu-li {
padding: 10px 0;
border-bottom: 1px solid rgba(50, 50, 50, 0.3);
width: 100%;
}
.sub-menu-li {
padding: 10px;
padding-right: 0;
width: calc(100% - 10px);
border-top: 1px solid rgba(50, 50, 50, 0.3);
}

Related

Anchor tag isn't displaying and is greyed out in in dev tools

I have been fighting with this section of code for a good few hours and cant figure out why it's greyed out in the browser and in dev tools. its suppose to display a title of the listed item. So far Im not seeing any Title unless I remove the class="ad-box-title" from the tag.
CSS
/*Ad box*/
.modern-img-indicator{
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0, 0.2);
font-size: 11px;
padding: 5px;
color: #ffffff;
}
.ad-box {
background: #fff none repeat scroll 0 0;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
position: relative;
margin-bottom: 20px;
}
.ad-box .ads-thumbnail {
display: block;
overflow: hidden;
position: relative;
border-radius: 3px 3px 0 0;
height: 158px;
}
.ad-box .caption {
background: #fff none repeat scroll 0 0;
padding: 7px 10px;
}
.ad-box-caption-title {
height: 32px;
margin-bottom: 5px;
overflow: hidden;
}
.ad-box-caption-title .ad-box-title {
color: #666666;
}
.ad-box-category {
font-size: 11px;
height: 30px;
border-top: 1px solid #e7e7e7;
line-height: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ad-box-footer {
background-color: #f6f6f6;
border-radius: 0 0 3px 3px;
border-top: 1px solid #e7e7e7;
box-shadow: 0 1px 0 0 #fff inset;
padding: 5px 8px;
position: relative;
}
span .ad-box-footer, .ad-box-price {
display: block;
}
.ad-box-price {
font-size: 12px;
}
.ad-box-premium i {
margin-top: 7px;
color: #f21aa5;
}
.ad-box-premium {
border-left: 1px solid #ddd;
color: #aaa;
cursor: default;
height: 28px;
position: absolute;
right: 1px;
text-align: center;
top: 1px;
transition: color 0.15s linear 0s;
width: 29px;
}
.ad-box-premium img {
max-height: 25px;
width: auto;
}
.countdown{
padding: 5px;
font-size: 14px;
text-align: center;
}
.place-bid-btn{
text-align: center;
}
HTML
<div class="col-md-3">
<div class="ad-box">
<!-- Thumbnail -->
<div class="ads-thumbnail">
<a href="#">
<img src="/uploads/thumbs/cat.jpg" alt="Auction title" class="img-fluid">
<span class="modern-img-indicator">
<i class="far fa-file-image"></i>
</span>
</a>
</div>
<!-- Caption -->
<div class="caption">
<div class="ad-box-caption-title">
<a href="#" class="ad-box-title">
Title Here
</a>
</div>
<div class="ad-box-category">
<a href="#" class="price text-muted">
<i class="far fa-folder"></i> Category Name Here
</a>
<a href="#" class="price text-muted">
<i class="fas fa-map-marker-alt"></i> Location Here
</a>
</div>
</div>
<!-- Box footer -->
<div class="ad-box-footer">
<span class="ad-box-price">Starting price here $0.00</span>
<span class="ad-box-price">Current Bid here $0.00</span>
<!-- If its a premium auction -->
<div class="ad-box-premium">
<img src="/images/premium-icon.png" alt="Premium Auction Image here">
</div>
<!-- Countdown -->
<div class="countdown">Time remaining</div>
<div class="place-bid-btn">
Place Bid
</div>
</div>
</div>
</div>

Dropdown Menu Automatically Open in IE

I'm making a landing page for a client with a dropdown menu. I'm using bootstrap. I've been having an issue where the dropdown options are already expanded on page load, but only for IE. They also do not have any of the normal formattings for an 'expanded' dropdown (background color should be white, it's not, etc.) Instead, all the li are translucent gray. The options are hoverable and selectable, but the dropdown menu will not close (the caret is essentially unresponsive).
This problem has happened before, on other sites, for this same client. The weirdest thing is, in the past, I have been able to get it to work by merely uploading the folder again to the client's servers. Same code, not working once, then uploaded again and then working. For the life of me, I can't figure out why this is happening
.hero .hero-selection select {
width: 250px;
border: none;
font-size: 14px;
font-family: Proxima Nova Thin;
-moz-box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
-webkit-box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
box-shadow: 0 0 0 35px rgba(255, 255, 255, .2);
background-color: #FFF;
color: #999;
border-radius: 0!important;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
padding: 15px 10px 10px;
}
.hero .hero-form-container .dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
margin: 2px 0 0;
padding: 5px 0;
}
.hero .hero-form-container .dropdown-menu>li>a {
display: block;
clear: both;
font-weight: 400;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
padding: 3px 20px;
}
.hero .hero-form-container ul {
width: 250px;
top: 91px;
border-radius: 0;
border: none;
background-color: #FFF;
color: #999;
padding: 0;
}
.hero .hero-form-container ul li a:hover {
background-color: #99d425;
font-family: Proxima Nova Thin;
font-size: 14px;
color: #999;
padding: 5px 5px 5px 15px;
}
.hero .hero-form-container ul li a {
font-family: 'Proxima Nova Thin';
font-size: 14px;
color: #999;
text-decoration: none;
padding: 5px 5px 5px 15px;
}
<div class="row">
<div class="col-sm-6 pull-left"><img id="nats-logo" style="" src="img/nats-logo-red.png" alt=""></div>
<div class="col-sm-6">
<div class="hero">
<div class="hero-form">
<div class="dropdown hero-selection">
<h5>Select your utility below:</h5>
<h2 style="margin-top: 20px">My Electricity Utility is:</h2>
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-expanded="true"> Select One<span class="caret"></span> </button>
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="notlisted" class="is-active">[not listed]</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="EBG">BGE</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="CNM">Delmarva Power (MD)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="PED">Pepco (DC)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="PEM">Pepco (MD)</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="APM">Potomac Edison</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" value="SME">SMECO</a></li>
</ul>
</div>
<form action="https://one.wglenergy.com/portal/rc_engine_by_ldc.php" id="form1">
<input type="hidden" name="super_rc" value="NATS">
<input type="hidden" name="cust_type" value="RES">
<input type="hidden" name="ldc_g" id="ldc_g">
<input type="hidden" name="ldc_e" id="ldc_e">
<input type="submit" id="go-button" value="See Your Pricing">
</form>
</div>
</div>
</div>
</div>
</div>

Fixed list item in dropdown menu UL

Its possible to have an LI fixed at a position and make the rest of the LI scrollable?
I want to have a ul where the first item is fixed, since its a search box, and make the other items, that are loaded with ng-repeat, scrollable.
I came to a solution but it's not UX ok...
My html:
<ul ng-if="filter.isSearchListType && hasFilterValues(filter)" class="dropdown-menu">
<li class="individual-search">
<input type="search" ng-model="searchInputText" class="form-group filter-input" placeholder="Nombre o E-mail" />
<i ng-show="searchInputText" class="fa fa-remove clear-search-icon" aria-hidden="true" ng-click="searchInputText = ''; $event.stopPropagation()"></i>
<i class="fa fa-search search-icon" aria-hidden="true" ng-click="$event.stopPropagation()"></i>
</li>
<li>
<ul class="pre-scrollable2">
<li ng-repeat="filterValue in filter.values | searchInData:searchInputText">
<a href="#" ng-click="selectFilterValue(filter, filterValue.id)" ng-class="{ 'selected': isSelectedFilter(filter, filterValue.id) }">
{{filterValue.label}}
</a>
</li>
</ul>
</li>
</ul>
CSS pre-scrollable2 is kinda a copy of dropdown-menu:
.pre-scrollable2 {
max-height: 340px;
overflow-y: scroll;
/*list-style-type: none;*/
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
/*display: none;*/
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, .15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.pre-scrollable2 > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333;
white-space: nowrap;
}
.pre-scrollable2 > li > a:hover,
.pre-scrollable2 > li > a:focus {
color: #262626;
text-decoration: none;
background-color: #f5f5f5;
}
In my experience you have to seperate the two lists and stack them on top of eachother to make them look like one list. then the top list set the position to fixed for the fixed search bar then the bottom set overflow to auto to get a scroll effect. create a navbar class set its width to whatever and the height to 100vh
<div class="navbar">
<ul ng-if="filter.isSearchListType && hasFilterValues(filter)" class="searchbar">
<li class="individual-search">
<input type="search" ng-model="searchInputText" class="form-group filter-input" placeholder="Nombre o E-mail" />
<i ng-show="searchInputText" class="fa fa-remove clear-search-icon" aria-hidden="true" ng-click="searchInputText = ''; $event.stopPropagation()"></i>
<i class="fa fa-search search-icon" aria-hidden="true" ng-click="$event.stopPropagation()"></i>
</li>
</ul>
<ul class="bottomlist">
<li ng-repeat="filterValue in filter.values | searchInData:searchInputText">
<a href="#" ng-click="selectFilterValue(filter, filterValue.id)" ng-class="{ 'selected': isSelectedFilter(filter, filterValue.id) }">
{{filterValue.label}}
</a>
</li>
</ul>
</div>
<style>
.navbar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
height: 100vh;
width: 20vw;
}
.searchbar {
postion: fixed;
top: 0;
}
.bottomlist {
overflow: auto;
postion: relative;
}
</style>

How to display a forum link and user who posted it in my forum?

I would like to display a forum link, which at right side should also display a user with latest post or thread in a forum.
Apparently here is what I have done.
CODE HTML:
<div class="container">
<div class="toggle"></div>
<h2>INFORMACJE</h2>
<div class="city">
<ul>
<li>ogłoszenia i nowości</li>
<li>Feedback</li>
</ul>
</div>
</div>
CODE CSS:
.toggle {
display:inline-block;
height:48px;
width:48px;
float: right;
background:url("http://cdn2.iconfinder.com/data/icons/onebit/PNG/onebit_32.png");
}
.toggle.expanded{
background:url("http://icons.iconarchive.com/icons/pixelmixer/basic/48/plus-icon.png");
}
h2 {
color: white;
background-color: rgb(36, 37, 38);
padding: 11px 10px 11px 10px;
margin: 0;
border-width: 0;
border-radius: 4px;
border: 1px solid rgb(70, 70, 70);
margin-bottom: 10px;
}
Here is what I get :(
Here is how the final results should look.
How can I achieve that? am newbie please help
check it in jsfiddle: https://jsfiddle.net/kh3u0q0r/
Is this is what you looking for???
.toggle {
display: inline-block;
height: 48px;
width: 48px;
float: right;
background: url("http://cdn2.iconfinder.com/data/icons/onebit/PNG/onebit_32.png");
}
.first {
float: left;
}
.second {
float: right;
}
.toggle.expanded {
background: url("http://icons.iconarchive.com/icons/pixelmixer/basic/48/plus-icon.png");
}
h2 {
color: white;
background-color: rgb(36, 37, 38);
padding: 11px 10px 11px 10px;
margin: 0;
border-width: 0;
border-radius: 4px;
border: 1px solid rgb(70, 70, 70);
margin-bottom: 10px;
}
<div class="container">
<div class="toggle"></div>
<h2>INFORMACJE</h2>
<div class="city">
<ul>
<li class="first">ogłoszenia i nowości
</li>
<li class="second">
Feedback
</li>
</ul>
</div>
</div>

Spacing between menu items (CSS)

I have a menu that works on large screens but when the browser size is reduced in width (and the menu wraps) I can't get the menu items not to overlap each other.
HTML:
<div style="padding-top: 10px">
<a class="menu" style=
"border: #B1B1B1 solid; border-width: 0px 1px 0px 1px" href="#">Design
and Install</a><a class="menu" href="#">About this site</a><a class=
"menu" href="#">Products</a><a class="menu" href="#">F A Q</a><a class=
"menu" href="#">Portfolio</a><a class="menu" href="#">Contact</a>
</div>
CSS:
.menu {
font-family: Verdana;
font-size: 12px;
color: #000;
text-align: center;
text-decoration: none;
border: #B1B1B1 solid;
border-width: 0 1px 0 0;
padding: 10px 17px 10px 12px;
}
.menu:link,.menu:visited {
background-color: #E5E5E5;
}
.menu:hover,.menu:active {
background-color: #F9C232;
}
http://jsfiddle.net/9j77E/1/
Thanks if you can help.
Try adding display: inline-block; to .menu
.menu {
font-family:Verdana;
font-size: 12px;
color: #000000;
text-align: center;
text-decoration: none;
border: #B1B1B1 solid;
border-width: 0px 1px 0px 0px;
padding: 10px 17px 10px 12px;
display:inline-block;
}
display:inline-block; this property added and tested, please check.
Also if I'm too late you could also set line-height to 32. Because your font-size is 12px plus 2 times 10px padding.