Change css cof another element if other css elements are enabled - css

I cant figure out or even know if its possible but I'd like to change CSS elements of an ID if certain CSS elements are present. Eg:
Ive added the HTML for the menu and the HTML for the sidebar menu that I need to modify to change its size based on the menu item being toggled or not but only on toggle.
.nav-collapse.in.collapse {
#sidebarMenu {
width: min-content;
}
<div class="nav-collapse in collapse" style="height: auto;">
<ul class="nav nav-menu" id="navigationMenu">
<li class="item-test"><a target="_blank" href="/site/index.php/gii">GII </a></li>
<li class="item-test">Dashboard</li>
<li class="dropdown item-test" tabindex="-1"><a class="dropdown-toggle" data-toggle="dropdown" href="#">System <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="item-test">Email Log <img src="/site/images/modelIcons/emailLog.png"></li>
<li class="item-test">Flush Cache <img src="/site/images/modelIcons/action.png"></li>
<li class="item-test">Graph Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Languages <img src="/site/images/modelIcons/language.png"></li>
<li class="item-test">Reports <img src="/site/images/modelIcons/report.png"></li>
<li class="item-test">Report Parameters <img src="/site/images/modelIcons/parameter.png"></li>
<li class="item-test">System Parameters <img src="/site/images/modelIcons/parameter.png"></li>
<li class="item-test">Translations <img src="/site/images/modelIcons/sourceMessage.png"></li>
<li class="item-test">Trashed Items <img src="/site/images/modelIcons/trash.png"></li>
</ul>
</li>
<li class="dropdown item-test" tabindex="-1"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Master <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="item-test">Asset Detail Types <img src="/site/images/modelIcons/assetDetailType.png"></li>
<li class="item-test">Asset Expiration Types <img src="/site/images/modelIcons/expire.png"></li>
<li class="item-test">Asset Statuses <img src="/site/images/modelIcons/status.png"></li>
<li class="item-test">Asset Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Asset Type Categories <img src="/site/images/modelIcons/category.png"></li>
<li class="item-test">Asset Type Specification Types <img src="/site/images/modelIcons/assetSpecificationType.png"></li>
<li class="item-test">Risk Classifications <img src="/site/images/modelIcons/riskClassification.png"></li>
<li class="item-test">Class Classifications <img src="/site/images/modelIcons/classClassification.png"></li>
<li class="item-test">Currency <img src="/site/images/modelIcons/currency.png"></li>
<li class="item-test">Designations <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Device Statuses <img src="/site/images/modelIcons/status.png"></li>
<li class="item-test">File Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Industries <img src="/site/images/modelIcons/industry.png"></li>
<li class="item-test">Manufacturer Detail Types <img src="/site/images/modelIcons/assetDetailType.png"></li>
<li class="item-test">Mark Up Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Measurement Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Organisation Relationship Provider Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Part Categories <img src="/site/images/modelIcons/partCategory.png"></li>
<li class="item-test">Quotation Statuses <img src="/site/images/modelIcons/status.png"></li>
<li class="item-test">Recall Directive Types <img src="/site/images/modelIcons/type.png"></li>
<li class="item-test">Sales Order Statuses <img src="/site/images/modelIcons/status.png"></li>
<li class="item-test">Service Task Outcomes <img src="/site/images/modelIcons/serviceTaskOutcome.png"></li>
<li class="item-test">Units of Measure <img src="/site/images/modelIcons/unitOfMeasure.png"></li>
<li class="item-test">User Detail Types <img src="/site/images/modelIcons/assetDetailType.png"></li>
<li class="item-test">Work Order Priorities <img src="/site/images/modelIcons/priority.png"></li>
<li class="item-test">Work Order Statuses <img src="/site/images/modelIcons/status.png"></li>
</ul>
</li>
<div class="searchbar-tabs">
<ul id="sidebarMenu">
<li class=""><i class="icon-white icon-home"></i> Dashboard</li>
<li id="actionMenu" class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-white icon-list"></i> Actions <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><i class="icon icon-align-left"></i> View Progress</li>
<li><i class="icon icon-download"></i> Export Work Order Spreadsheet</li>
<li><a target="_blank" href="/site/index.php/workOrder/workOrder/viewSummaryReport/assetGroupId"><i class="icon icon-print"></i> Work Order Summary</a></li>
<li><a class="batchReissueCertificates" href="/site/index.php/workOrder/workOrder/batchCertificateReissue/assetGroupId"><i class="icon icon-print"></i> Reissue (Update) Certificates</a></li>
<li><a class="batchReissueCertificates" href="/site/index.php/workOrder/workOrder/batchCertificateReissue/assetGroupId//replica/1"><i class="icon icon-print"></i> Reissue Certificates</a></li>
<li><i class="icon icon-remove"></i> Manage Trashed Work Orders</li>
<li><i class="icon icon-cog"></i> Manage Batch Work Orders</li>
</ul>
</li>
<li>
<a id="contextProcess" href="/site/index.php/workOrder/workOrder/process/permissionId"><img src="/site/images/modelIcons/process.png">Processes</a>
</li>
</ul>
</div>

get both element by id or class. toggle active class to the element which has to be watched. check if it has active class then it will be present and you can change the properties of other element. vice-versa.

Related

Navigation Link is taking the whole width

I need to place an icon in my navigation. I am using mdbootstrap. If I do not put any icon, I get the navigation aligned right like so:
but when I place an image, the links are not aligned any more.
I think the reason for that when I add an image the navlink occupies the whole space like so in the inspector:
This is my code:
<mdb-navbar
SideClass="navbar navbar-expand-lg scrolling-navbar class z-depth-0"
>
<mdb-navbar-brand>
<a class="navbar-brand" [routerLink]="['']">
<img
src="../../../assets/imgs/Autosweep-Logo-portrait-hi-res-1.jpg"
height="100"
class="d-inline-block align-top"
alt=""
/>
</a>
</mdb-navbar-brand>
<links class="mt-4" style="margin-left: 50px;">
<ul class="nav justify-content-center">
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['subscribe-now']"
routerLinkActive="active">
<img src="../../../assets/imgs/icons/Subscribe 2.png" style="width: 7%; height: 7%;"/>
<br>
Subscribe Now
</a>
</li>
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['forms']"
routerLinkActive="active"
>
Forms</a
>
</li>
<li class="nav-item size-fonts">
<a
href="https:www.autosweeprfidapps.com/balanceinquiry"
class="nav-link waves-light"
mdbWavesEffect
>Balance Inquiry</a
>
</li>
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['reloading']"
routerLinkActive="active"
>Stations & Reloading Partners</a
>
</li>
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['ada-enrollment']"
routerLinkActive="active"
>ADA Re-Activation</a
>
</li>
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['events']"
routerLinkActive="active"
>Events</a
>
</li>
<li class="nav-item size-fonts">
<a
class="nav-link waves-light"
mdbWavesEffect
[routerLink]="['customer-care']"
routerLinkActive="active"
>Customer Care</a
>
</li>
</ul>
</links>
</mdb-navbar>
Take the <br> out so it would look like this
[routerLink]="['subscribe-now']"
routerLinkActive="active">
<img src="../../../assets/imgs/icons/Subscribe 2.png" style="width: 7%; height: 7%;"/>
Subscribe Now
</a>
</li>

want to make custom dropdown in first level in wordpress with menu code, but am not getting where to start?

here is code what I want to achieve by WordPress custom dropdown but I can't, can anyone tell me how can I do that, and other menu items should be normal and simple
[![<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="products.html">Products <span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="nav-item">
<a class="dropdown-item" href="#">
<div class="img">
<img src="images/dropdown-img.jpg" alt="">
</div>
<span class="title">Cable &<br> Cable Accessories</span>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link dropdown" href="service.html">Service</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li class="nav-item">
<a class="dropdown-item" href="#">
DEMO
</a>
</li>
<li class="nav-item">
<a class="dropdown-item" href="#">
DEMO
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="brands.html">Contact</a>
</li>
</ul>][1]][1]

Uib Dropdown With Empty Name/Lable not Opening

In my application there can me multiple dropdowns with empty name
(meaning they do not have a value set to them).
But uib-dropdown does not open when it has empty name/lable.
What can I do?
<div>
<span uib-dropdown on-toggle="toggled(open)">
<a href id="simple-dropdown" uib-dropdown-toggle>
</a>
<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="simple-dropdown">
<li ng-repeat="choice in items">
<a href>{{choice}}</a>
</li>
</ul>
</span>
</div>
Plunker
Just Adding &nbsp works
<div>
<span uib-dropdown on-toggle="toggled(open)">
<a href id="simple-dropdown" uib-dropdown-toggle>
</a>
<ul class="dropdown-menu" uib-dropdown-menu aria-labelledby="simple-dropdown">
<li ng-repeat="choice in items">
<a href>{{choice}}</a>
</li>
</ul>
</span>
</div>
plunker

Bootstrap 4 - Modal Dialog with Tabs - Drop Down Menu

I am working in Bootstrap 4 and I have created a Modal Dialog Box. I want the last link on the Modal Dialog Box to be a dropdown menu, but I can't seem to get the code just right.
My HTML, CSS and JQuery code can be found here at JSFiddle:
<div class="modal fade" id="MyModal" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="tabbable">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item active">
<a class="nav-link active" href="#AAA" data-toggle="tab">
AAA
</a>
</li>
<li>
<a class="nav-link" href="#BBB" data-toggle="tab">
BBB
</a>
</li>
<li>
<a class="nav-link" href="#CCC" data-toggle="tab">
CCC
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" id="DDL" href="#DDL">
Menu
</a>
<ul class="dropdown-menu">
      <li>
<a class="dropdown-item" href="#News">
News
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
You don't want the href="..." set to an element that doesn't exist (#DDL). Just remove it and it will find the next dropdown-menu.
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="">
Menu
</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="#News">
News
</a>
</li>
</ul>
</li>
https://www.codeply.com/go/nbXb8ipmxl

Selecting CSS3 Last Child Within Drop Down Menu Not Working

Frustratingly not been able to resolve the CSS3 pseudo element 'last-child' that isn't working with this custom drop down navigation menu that we're working on currently.
Each drop down menu can be assigned a number of columns, in this instance, I am wanting to apply a right hand border to each column (.col_1) within the div .dropdown_3column.
CSS Snippet
.dropdown_1column_simple {width: 100px;}
.dropdown_2column_simple {width: 155px;}
.dropdown_1column {width: 550px;}
.dropdown_2column {width: 650px;}
.dropdown_3column {width: 500px;}
.dropdown_4column {width: 800px;}
.dropdown_5column {width: 1000px;}
.dropdown_2column_simple .col_1 {width:155px;}
.dropdown_2column_simple .col_2 {width:155px;}
.col_1 {width:145px; border-right: 1px solid #888;}
.col_2 {width:240px;}
.col_3 {width:490px;}
.col_4 {width:440px;}
.col_5 {width:575px;}
.col_s {width:250px;}
.col_1,.col_2,.col_3,.col_4,.col_5 {
display:inline;
float: left;
position: relative;
margin-left: 5px;
margin-right: 5px;
/*border: 1px solid #000;*/
}
HTML Snippet
<div class="dropdown_3column align_left ">
<div class="col_3">
<div class="content_top"></div>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/addict-clothing.html">
<span class="level1">Addict Clothing </span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/atticus-clothing.html">
<span class="level1">Atticus Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dephect-clothing.html">
<span class="level1">Dephect Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dickies-clothing.html">
<span class="level1">Dickies</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dta-clothing.html">
<span class="level1">DTA Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/famous-stars-and-straps-clothing.html">
<span class="level1">Famous Stars And Straps Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/fuct-clothing.html">
<span class="level1">FUCT Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/hex-accessories.html">
<span class="level1">HEX Accessories</span>
</a>
</li>
</ul>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/the-hundreds.html">
<span class="level1">The Hundreds</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/insight-clothing.html">
<span class="level1">Insight Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/jeepney-clothing.html">
<span class="level1">Jeepney Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/king-apparel.html">
<span class="level1">King Apparel</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/lrg-clothing.html">
<span class="level1">LRG Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/my-yard-clothing.html">
<span class="level1">My Yard</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/new-era-5950.html">
<span class="level1">New Era 5950 Hats and Apparel</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/pxl-clothing.html">
<span class="level1">PXL Clothing</span>
</a>
</li>
</ul>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/rebel8-clothing.html">
<span class="level1">REBEL8 Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/ringspun-clothing.html">
<span class="level1">Ringspun</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/rogue-status-clothing.html">
<span class="level1">Rogue Status </span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/the-wild-ones-clothing.html">
<span class="level1">The Wild Ones</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/volcom-clothing.html">
<span class="level1">Volcom Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/zoo-york-clothing.html">
<span class="level1">Zoo York Clothing</span>
</a>
</li>
</ul>
</div>
<div class="col_3">
<div class="content_bottom"></div>
</div>
<div class="col_s">
<div class="content_side"></div>
</div>
</div>
A live version of the problem can be seen here. It is the 'Brands' dropdown in question that I am trying to remove the right hand border from the 3rd (last) column.
I'm aware of browser incompatibilities and other alternatives using JS / jQuery that exist perhaps but I'm only interested in trying to resolve this with the CSS.
I'm thinking perhaps this needs a fresh pair of eyes because I've tried tons of variations and not managed to select the last column within that drop down I believe.
Thanks in advance.
EDIT: I have attempted tons of variations but I think the issue is my inability to work out the last child of the parent item which doesn't count other divs too. I've been trying with the likes of:
div:last-child .col_1 {border-right: none !important;}
Thanks.
EDIT 2: Please find instance of my issue on JS Fiddle too if it helps anyone.
Thanks.
You are not using selectors right.
Here is a fix using nth-child:
http://jsfiddle.net/BUhgZ/3/

Resources