make clickable area of <a> fill containing <div> - html

In the demonstration below, clicking the arrow in the small blue box opens a menu. But only clicking directly on the arrow itself will trigger the menu. How can I make a click anywhere in the small blue box open the menu?
I tried putting the <a> tag first, but the menu disappeared.
body {
margin-top: 50px;
}
ul.dropdown-menuoption {
top: auto;
background: #337ab7;
border-width: 0;
}
.prSemTA {
background: #337ab7;
border-radius: 3px;
font-size: 15px;
padding: 3px 5px 3px 4px
}
.prSemTA a {
color: #FFF;
text-decoration: none;
}
.prSemTA a:hover {
color: #333;
text-decoration: none;
}
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" rel="stylesheet"/>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div style="float:left;padding-left:5px;">
<div class="pull-left prSemTA">
<a href="" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="glyphicon glyphicon-chevron-down"></i>
</a>
<ul class="dropdown-menu dropdown-menuoption">
<li> <i class="glyphicon glyphicon-comment"></i> xxx</li>
<li><i class="glyphicon glyphicon-heart"></i> xxx</li>
<li><i class="glyphicon glyphicon-edit"></i> xxx</li>
<li><i class="glyphicon glyphicon-remove"></i> xxxx</li>
</ul>
</div>
</div>
View on JSFiddle

You can try below code:
.prSemTA {
background: #337ab7;
border-radius:3px;
font-size:15px;
}
.prSemTA a {
color: #FFF;
text-decoration: none;
display:block;
padding:3px 5px 3px 4px
}
Working Demo

Related

restrict div resize on button hover

I'm creating a nav bar with buttons using css that I'd like to have a background color on hover WITHOUT the div resizing. I want the buttons to stay in place, just have the background color behind them.
.topnav {
overflow: hidden;
background-color: #1C313A;
}
.topnav a {
float: left;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav-right {
float: right;
}
button {
padding: 0px 0px;
background-color: transparent;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
margin-left: 20px;
}
button:hover {
width: 50px;
height: 50px;
background-color: #192C34;
border-radius: 50%;
padding: 0px 0px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="topnav">
<a href="#home">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<a href="#news"><button>
<i class="fa fa-upload fa-lg"></i>
</button></a>
<a href="#contact">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<div class="topnav-right">
<a class="logo" style="pointer-events:none;">TidyBlocks</a>
</div>
</div>
Current Output:
Desired Output
.topnav {
overflow: hidden;
background-color: #1C313A;
}
.topnav a {
float: left;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav-right {
float: right;
}
button {
padding: 0px 0px;
background-color: transparent;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
margin-left: 20px;
width: 50px;
height: 50px;
}
button:hover {
background-color: #192C34;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="topnav">
<a href="#home">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<a href="#news"><button>
<i class="fa fa-upload fa-lg"></i>
</button></a>
<a href="#contact">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<div class="topnav-right">
<a class="logo" style="pointer-events:none;">TidyBlocks</a>
</div>
</div>
Please put height and width in button not hover.
And yes you can't put button element in a tag it's not validated.
Please check your code on https://validator.w3.org/.
.topnav {
overflow: hidden;
background-color: #1C313A;
}
.topnav a {
float: left;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav-right {
float: right;
}
button {
border-radius: 50%;
padding: 0px 0px;
background-color: transparent;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease 0s;
margin-left: 20px;
width: 50px;
height: 50px;
}
button:hover {
background-color: #192C34;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="topnav">
<a href="#home">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<a href="#news"><button>
<i class="fa fa-upload fa-lg"></i>
</button></a>
<a href="#contact">
<button>
<i class="fa fa-save fa-lg"></i>
</button>
</a>
<div class="topnav-right">
<a class="logo" style="pointer-events:none;">TidyBlocks</a>
</div>
</div>

How to align icons and fonts with similar margin

I am trying to get my icons and text to have same padding or margin. If you run the code you will see one category is near an icon and other one is far. I want to have consistency. I tried a lot of things but it doesnt reflect anything
.category_nav
{
height: 40px;
margin-top: 38px;
}
.category_nav_ul
{
list-style-type: none;
padding:0;
}
.category_nav_ul > li
{
display: inline-block;
}
#category_nav_ul_category
{
width: 380px;
cursor: pointer;
}
#category_nav_div
{
margin-top: 5px;
width: 380px;
position: absolute;
background-color: white;
padding-bottom: 10px;
}
#categories_content
{
margin-top: 10px;
}
.category_nav_div .content:hover
{
}
.categories
{
list-style: none;
}
.category
{
padding-top: 6px;
padding-bottom: 6px;
margin-bottom: 1px;
border: 0;
border-radius: 0;
}
.category:hover
{
border: 2px;
background:linear-gradient(to right, red 0px, red 3px, transparent 3px);
background-color: white;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
}
.category_icon
{
width: 20px !important;
padding-right: 5px;
background-color: red;
}
.category_content
{
margin-left: 15px !important;
}
.light-border
{
border: 1px solid #e8e8e8;
border-top: none;
}
h2.flash_title
{
color: rgb(120, 120, 120);
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
background: #fff;
color: #666;
font-size: 14px;
padding-left: 19px;
font-weight: 400;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="category_nav_div" class="light-border">
<div class="content" id="categories_content">
<ul class="categories list-group">
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-camera"></i>
</span>
<span class="category_content">
Camera
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-info-circle"></i>
</span>
<span class="category_content">
Clothes
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-mobile"></i>
</span>
<span class="category_content">
Mobiles
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-info-circle"></i>
</span>
<span class="category_content">
Graphics Cards
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-television"></i>
</span>
<span class="category_content">
Television
</span>
</li>
</ul>
</div>
</div>
In i tag you can use a class fa-fw, so all the icons has the same width
Example
<i class="fa fa-television fa-fw"></i>
add this class in all the i tags
.category_nav
{
height: 40px;
margin-top: 38px;
}
.category_nav_ul
{
list-style-type: none;
padding:0;
}
.category_nav_ul > li
{
display: inline-block;
}
#category_nav_ul_category
{
width: 380px;
cursor: pointer;
}
#category_nav_div
{
margin-top: 5px;
width: 380px;
position: absolute;
background-color: white;
padding-bottom: 10px;
}
#categories_content
{
margin-top: 10px;
}
.category_nav_div .content:hover
{
}
.categories
{
list-style: none;
}
.category
{
padding-top: 6px;
padding-bottom: 6px;
margin-bottom: 1px;
border: 0;
border-radius: 0;
}
.category:hover
{
border: 2px;
background:linear-gradient(to right, red 0px, red 3px, transparent 3px);
background-color: white;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
}
.category_icon
{
width: 20px !important;
padding-right: 5px;
background-color: red;
}
.category_content
{
margin-left: 15px !important;
}
.light-border
{
border: 1px solid #e8e8e8;
border-top: none;
}
h2.flash_title
{
color: rgb(120, 120, 120);
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
background: #fff;
color: #666;
font-size: 14px;
padding-left: 19px;
font-weight: 400;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="category_nav_div" class="light-border">
<div class="content" id="categories_content">
<ul class="categories list-group">
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-fw fa-camera"></i>
</span>
<span class="category_content">
Camera
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-fw fa-info-circle"></i>
</span>
<span class="category_content">
Clothes
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-fw fa-mobile"></i>
</span>
<span class="category_content">
Mobiles
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-fw fa-info-circle"></i>
</span>
<span class="category_content">
Graphics Cards
</span>
</li>
<li class="category list-group-item">
<span class="category_icon">
<i class="fa fa-fw fa-television"></i>
</span>
<span class="category_content">
Television
</span>
</li>
</ul>
</div>
</div>
Font-awesome has a class specially to do that. fa-fw
<div class="list-group">
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw" aria-hidden="true"></i> Home</a>
<a class="list-group-item" href="#"><i class="fa fa-book fa-fw" aria-hidden="true"></i> Library</a>
<a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Applications</a>
<a class="list-group-item" href="#"><i class="fa fa-cog fa-fw" aria-hidden="true"></i> Settings</a>
</div>
http://fontawesome.io/examples/

Align caret with dotted bottom border in Bootstrap

I'd like to align a caret with a dotted bottom border.
I managed to achieve it using this code but it works only in Chromium.
HTML:
<h2 id="a11y-291">
More <div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle h2Title" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="dashedUnderline">albums</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
artists
</li>
<li class="active">
albums
</li>
</ul>
</div>
</h2>
and css:
.noMarginTop {
margin-top: 0;
}
.h2Title {
border: none;
font-size: 30px;
padding: 0;
line-height: 1em;
}
.h2Title:active,
.h2Title:hover,
.h2Title:focus {
background-color: transparent;
}
.caret {
display: inline-block;
margin-top: 1em; // Not aligned in FF
}
.h2Title .caret {
margin-left: 3px;
}
.dashedUnderline {
border-bottom: 1px dotted black;
}
.dropdown-menu {
left: 0;
right: 0;
min-width: 0;
}
It works as expected in Chromium:
But there is a slight offset in Firefox:
Has anyone a more reliable way to achieve this? I cannot figure out what differs between Firefox and Chromium resulting in an offset.
Thanks
.noMarginTop {
margin-top: 0;
}
.h2Title {
border: none;
font-size: 30px;
padding: 0;
line-height: 1em;
}
.h2Title:active,
.h2Title:hover,
.h2Title:focus {
background-color: transparent;
}
.h2Title .caret {
margin-left: 3px;
}
/* you must add display:inline-block to.dashedUnderline and .caret */
.dashedUnderline, .caret {
display:inline-block;
float:left;
}
.caret {
margin-top: 29px;
}
.dashedUnderline {
border-bottom: 1px dotted black;
}
.dropdown-menu {
left: 0;
right: 0;
min-width: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="btn-group">
<h2 id="a11y-291">
More
<button type="button" class="btn btn-default dropdown-toggle h2Title" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="dashedUnderline">albums</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
artists
</li>
<li class="active">
albums
</li>
</ul>
</h2>
</div>

bootstrap navbar list dropdown extends far too wide

I have a navbar dropdown with the 'bell' icon that will hopefully show some notifications.
When for example, I add more text lines to any list item, the sentence extends horizontally and does not break on a new line, thus the dropdown box just keeps exceeding in width.
I have added this image to show what I mean:
How do I stop this? I dont want to give it a fixed width because the list item just breaks free out of the dropdown box and goes on extending.
here is my code:
body {
padding-top: 102px;
background-color: #4d4d4d;
font-family: 'Lato', verdana, sans-serif;
}
.container {
width: 1530px;
margin-top: 0;
}
.navbar-fixed-top {
background-color: #fff;
}
.navbar-header {
min-height: 80px;
}
.hamburger-icon {
margin-top: 20px;
}
.navbar-default .navbar-brand {
line-height: 45px;
font-size: 45px;
color: #010101;
text-transform: uppercase;
}
.navbar-default .navbar-brand span {
font-style: normal;
color: #ff5500;
}
.search .input-group {
padding-top: 15px;
font-family: 'Lato', sans-serif;
}
.search .input-group input.search-field {
border-radius: 0;
border: 0;
box-shadow: none;
background-color: #fff;
font-size: 18px;
font-weight: 100;
}
.search .input-group input.search-field:hover {
background-color: transparent;
}
.search .input-group-btn button {
padding: 2px;
border: 0;
box-shadow: none;
background-color: transparent;
border-radius: 0;
}
.search .input-group-btn button:hover {
background-color: #f8f8f8;
color: #ff5500;
}
.search .input-group-btn .glyphicon-search {
font-size: 22px;
}
.dropdown-toggle.inbox {
padding-top: 15px;
margin-bottom: 5px;
}
.dropdown-menu li {
width: 400px;
}
.dropdown-menu.bell {
background-color: #f8f8f8;
border-radius: 0;
box-shadow: 0;
}
.dropdown-menu.bell h4 {
padding: 10px 0;
color: #010101;
text-align: center;
display: block;
}
.dropdown-menu.bell li a {
padding-top: 5px;
padding-bottom: 5px;
}
.nav>li.dropdown.bell>a:hover,
.nav>li.dropdown.bell>a:focus {
background-color: transparent;
}
.dropdown-menu.bell li.divider {
padding: 0;
margin: 0 20px;
}
.dropdown-menu.bell .label {
background-color: transparent;
color: #ff5500;
font-weight: 100;
}
.badge-notify {
background: #ff5500;
margin-top: -24px;
margin-left: -20px;
height: 1.7em;
}
/* caret for notification dropdown */
.dropdown-menu.bell:before {
position: absolute;
top: -10px;
right: 10%;
display: inline-block;
border-right: 10px solid transparent;
border-bottom: 10px solid #ccc;
border-left: 10px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: '';
}
.dropdown-menu.bell:after {
position: absolute;
top: -9px;
right: 10%;
display: inline-block;
border-right: 9px solid transparent;
border-bottom: 9px solid #f8f8f8;
border-left: 9px solid transparent;
content: '';
}
.user span.fullname {
font-size: 14px;
color: #010101;
font-weight: 400;
}
.user span:last-child {
padding-right: 10px;
}
.user span:first-child {
padding-right: 30px;
padding-left: 10px;
}
.user .dropdown-menu.user-list {
width: 100%;
border-radius: 0;
border: 0;
background-color: #f8f8f8
}
.user .dropdown-menu.user-list li a {
margin: 5px 0px;
color: #010101;
}
.user .dropdown-menu.user-list li a:hover {
background-color: transparent;
color: #ff5500;
}
.user .dropdown-menu.user-list li.divider {
padding: 0;
margin: 0 20px;
}
/* Large desktop */
#media (max-width: 1590px) {
.container {
width: auto;
}
}
/* Portrait tablet to landscape and desktop */
#media (max-width: 979px) {}
/* Landscape phone to portrait tablet */
#media (max-width: 768px) {
.container {
width: auto;
}
.navbar-default .navbar-brand {
font-size: 40px;
}
.dropdown.bell .inbox {
width: 100% !important;
}
.dropdown-menu.bell h4 {
margin: 0 0;
}
.dropdown-menu.bell:before,
.dropdown-menu.bell:after {
display: none;
}
.bell,
.user {
text-align: center;
}
}
/* Landscape phones and down */
#media (max-width: 480px) {
.navbar-default .navbar-brand {
font-size: 30px;
}
}
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
<div class="container">
<div class="navbar navbar-default navbar-fixed-top navbar-md" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle hamburger-icon" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
BRAND<span>LOGO</span>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<!-- search bar -->
<li class="dropdown search">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control search-field" placeholder="Search name or keyword" name="q">
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<img src="https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/search-128.png" height="30" width="30" class=" avatar-img img-square">
</button>
</div>
</div>
</form>
</li>
<!-- notification bell -->
<li class="dropdown bell">
<a href="#" class="dropdown-toggle inbox" data-toggle="dropdown">
<img src="https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-ios7-bell-outline-128.png" height="45" width="45" class=" avatar-img img-square">
<span class="badge badge-notify">1</span>
</a>
<ul class="dropdown-menu bell" role="menu">
<li>
<h4 class="menu-title">Notifications</h4>
</li>
<li><span class="label label-default">4:00 AM</span>Favourites Snippet
</li>
<li class="divider"></li>
<li><span class="label label-warning">4:30 AM</span>Email marketing
</li>
<li class="divider"></li>
<li><a href="#"><span class="label label-warning">5:00 AM</span>Subscriber focused email blaaaa
blaaaddddddddddddddddddddddddddddddddddddddddddddddddblaaadddddddddddddddddddddddddddddddddddddddddddddddd
design</a>
</li>
<li class="divider"></li>
<li>View All
</li>
</ul>
</li>
<!-- user login information -->
<li class="dropdown user">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span><img src="https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/user_male2-128.png" height="50" width="50" ></span>
<span class="fullname">Jacky Smith</span>
<span><img src="https://cdn0.iconfinder.com/data/icons/slim-square-icons-basics/100/basics-08-128.png" height="20" width="20" ></span>
</a>
<ul class="dropdown-menu user-list" role="menu">
<li>Action
</li>
<li class="divider"></li>
<li>Another action
</li>
<li class="divider"></li>
<li>Something else here
</li>
<li class="divider"></li>
<li>Separated link
</li>
<li class="divider"></li>
<li>One more separated link
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<p>dfsjfhskfs</p>
<!-- <div class="chevron right">
</div>
<div style="height: 1em;">
</div> -->
</div>
</div>
</div>
</div>
If you don't want to give a fixed width, then you may use max-width.
It will not set any fixed width but when the text will exceed the given max-width, it will automatically break down to a new line.
This works. You have to stick a DIV to all content and occupying 12 cells text, and do not overflow. In the text I have also gotten a span, texts can not go empty label, everything should always be labeled
<li>
<div class="col-xs-12">
<a href="#">
<span class="label label-warning">5:00 AM</span>
<span>iber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla Subscriber focused email bla</span>
</a>
</div>
</li>
you should use a (max-width) for your div.
Property white-space: normal helps to wrap words on new line, when it necessary, but if you have too long words, property word-break: break-word helps you to break word on new line
.dropdown-menu.bell li a {
...
white-space: normal;
word-break: break-word;
}
JSFiddle-example
I finally got my solution working, with the help from the stackoverflow community!.
I included the following on my .dropdown-menu.bell > li > a:
white-space: normal;
width: 350px;

RTL support for bootstrap 3 submenus

I'm having a problem adjusting drop down sub menus to open to the right side (the software layout is in Hebrew).
I saw similar answers with providing external libraries, I don't want to do that. I want simply twick my css a bit so it will work ,I'm almost there, this is where you can help me :)
Those 2 pictures illustrate the issues I'm experiencing:
I have three problems:
change caret position to the left
change caret location to the left
open submenu to the left side (right now it opens to the left but overlaps with the main one, but I can live with that, the above 2 are much more important)
In this link, it is mentioned that bootstrap 3 doesn't support sub menus no more, I'm controlling it at my css.
**
html
**:
<div ng-show="buildings.total_buildings" tooltip="מגוון פעולות שניתן לבצע על הרשומות שבחרתם" class="btn-group">
<button class="btn btn-default dropdown-toggle btn-lg" data-toggle="dropdown">
<i class="fa fa-lg fa-building "></i>
<span class="caret"></span>
<span class="badge_success badge">{{buildings.total_buildings}}</span>
</button>
<ul class="dropdown-menu">
<li>
<i class="fa fa-file-pdf-o"></i> יצא לקובץ pdf
</li>
<li class="dropdown-submenu pull-left">
<i class="fa fa-envelope-o"></i> שלח מייל
<ul href="javascript:void(0);" class="dropdown-menu">
<li><i class="fa fa-building"></i> כולם
</li>
<li><i class="fa fa-building owner"></i> בעלים
</li>
<li><i class="fa fa-building renter"></i> שוכרים
</li>
<li><i class="fa fa-building defecto"></i> דיירים
</li>
</ul>
</li>
<li>
<i class="fa fa-comment-o"></i> שלח סמס
</li>
<li>
<i class="fa fa-envelope-o"></i> שלח מייל
</li>
<li>
<i class="fa fa-male"></i> הצג דיירים
</li>
<li>
<i class="fa fa-database"></i> קרא וטען נתונים
</li>
<li>
<i class="fa fa-trash-o"></i> מחק
</li>
</ul>
</div>
**
CSS
**:
.dropdown-submenu {
position: relative;
text-align: right;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: right !important;
}
.dropdown-submenu.pull-left>.dropdown-menu {
right: 100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
Please take a look at this jsFiddle. I've made a few changes to your CSS and added some new styles:
.btn-group, .btn-group-vertical {
float: right;
}
.dropdown-menu {
min-width: 190px;
}
.dropdown-menu>li>a {
text-align: right;
}
.dropdown-submenu>a:before {
content:'◄';
float: left;
margin-left: 0px;
color: #ccc;
font-size: 10px;
margin-top: 3px;
}
.dropdown-submenu>a:after {
display: none;
}
.dropdown-submenu>a:hover:before {
color: #fff;
}