css add a splitline between two div [duplicate] - css

This question already has answers here:
Separators for Navigation
(9 answers)
Closed 5 years ago.
Hi I'm trying to put a splitline between the tab "Home" and "Cart" and the tab "Help" and "Contact".
.tab-separator {display: inline-block;
padding-right: 5px;
border-right-style: solid;
border-right-width: thin;
border-right-color: red;
height: 10px;
}
<div class="tab-separator">
<div class="tab-menu" id="tab" style="display: inline-block;">
Home
</div>
</div>
<div class="tab-menu" id="tab1" style="display: inline-block;">
Cart
</div>
<div class="tab-separator">
<div class="tab-menu" id="tab2" style="display: inline-block;">
<a href="#">
Help
</a>
</div>
</div>
<div class="tab-menu" id="tab3" style="display: inline-block;">
Contact
</div>
I tried to do so by displaying the border right of the div that surrounds the div tab. But I have a problem I don't manage to move the splitline as I wish. I want it to not be so high, but if I set a margin top it doesn't work, it will move every tabs.
So what I want is the splitline to be a little lower, maybe 2 pixels lower.

You can put "|" easily with UL LI
ul li {
display: inline-block;
}
ul li:not(:last-child):after {
content: "|";
}
<ul class="standard-nav visible-lg">
<li><a id="intro-linker" class="scroll" href="#intro">Start a fire</a>
</li>
<li><a id="about-linker" class="scroll" href="#ourfires">Our fire</a>
</li>
<li><a id="services-linker" class="scroll" href="#pastfires">Past fires</a>
</li>
<li><a id="team-linker" class="scroll" href="#team">Chief fire lighter</a>
</li>
<li><a id="portfolio-linker" class="scroll" href="#seriesfires">Series of fires</a>
</li>
<li><a id="contact-linker" class="scroll" href="#contact">Get fired up</a>
</li>
</ul>

this can easily be done using border-right, like this :
.right_separator{
border-right: 1px solid;/*This will add a border for the right of the element*/
padding-right: 3px;
}
<div class="tab-menu right_separator" id="tab" style="display: inline-block;">
<a href="#">
Home
</a>
</div>
<div class="tab-menu right_separator" id="tab1" style="display: inline-block;">
<a href="#">
Cart
</a>
</div>
<div class="tab-menu right_separator" id="tab2" style="display: inline-block;">
<a href="#">
Help
</a>
</div>
<!-- Don't add .right_separator for the last element-->
<div class="tab-menu" id="tab3" style="display: inline-block;">
<a href="#">
Contact
</a>
</div>

Related

How to include forms over bg image and beside navbar

First problem; I have very little working knowledge of Bootstrap/CSS and have copied code from various places and adapted it myself to make my solution work.
Second problem; I know I need containers/rows/columns, but I'm unsure of how to nest them appropriately around my navbar (permanently affixed to the left) and on top of the background image.
This is for a mobile web application and I would like to create forms that will sit on top of the background image.
I have spent nearly 2 whole days researching and inserting containers, rows, columns, around my existing code but all it achieves is moving the layout, moving navbar to the centre and text appears above or below the image but not on top of the image. The background image is set in css in the head, code is below.
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: url("Red_polygon.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.navbar-custom {
background-color: rgba(22, 22, 22, 1)
}
.thumbnail {
float: left;
margin: 2px 0px 2px 2px;
background: transparent;
border: 0 none;
box-shadow: none;
}
<nav class="navbar navbar-custom navbar-fixed-top">
<div class="thumbnail" border="0">
<img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
</div>
</nav>
<body>
<nav class="navbar navbar-custom navbar-fixed-top">
<div class="thumbnail" border="0">
<img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
</div>
</nav>
<div class="bg">
<div class="wrapper">
</div>
<nav id="sidebar">
<ul class="list-unstyled components">
<p>
<center>
<h4>Management Information System</h4>
</center>
</p>
<li>
Project nav
<ul class="collapse list-unstyled" id="pageSubmenu">
<li>
Projects
</li>
<li>
Activities
</li>
<li>
Tasks
</li>
<li>
Staff
</li>
</ul>
</li>
<li>
Help
</li>
<li>
Contact
</li>
</ul>
<ul class="list-unstyled components">
<li>
Home
</li>
<li>
Logout
</li>
</ul>
</nav>
</div>
I am expecting there is something I have done incorrectly to structure the navbar and background image and just wondering if someone can help me understand what I have done wrong, and how to correct it. Apologies for the massive amount of code but I'm unsure what's relevant and what isn't after the amount of things I've tried. Thank you in advance and kindest regards.
I have inserted a very basic structure to incorporate what you have mentioned above. However, not sure if what you are intending with the code you have mentioned above. So let's talk further if you need more help.
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: url("https://www.publicdomainpictures.net/pictures/130000/velka/abstract-magical-background.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.navbar-custom {
background-color: rgba(22, 22, 22, 1)
}
.thumbnail {
float: left;
margin: 2px 0px 2px 2px;
background: transparent;
border: 0 none;
box-shadow: none;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<body class="">
<nav class="navbar navbar-custom navbar-fixed-top">
<div class="thumbnail" border="0">
<img src="ASD_header_logo.png" alt="Active Software Development" width=277 height=76 />
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-2">
<nav id="sidebar">
<ul class="list-unstyled components">
<p>
<center>
<h4>Management Information System</h4>
</center>
</p>
<li>
Project nav
<ul class="collapse list-unstyled" id="pageSubmenu">
<li>
Projects
</li>
<li>
Activities
</li>
<li>
Tasks
</li>
<li>
Staff
</li>
</ul>
</li>
<li>
Help
</li>
<li>
Contact
</li>
</ul>
<ul class="list-unstyled components">
<li>
Home
</li>
<li>
Logout
</li>
</ul>
</nav>
</div>
<div class="col-10">
<div class="bg">
<form class="text-white">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
</body>

How to display child component from left to right

I am rendering child component in for loop from parent component. My parent component should be float to right at the bottom of screen then after each render of child component should be render to left to my parent component
Parent component :
<div class="row">
<div class="content">
<div class="row">
<div class="col-md-12" id="ng-chat-view">
<div class="col-md-3">
<div id="ng-chat-people" [ngClass]="{'ng-chat-people-collapsed':isCollapsed}">
<a href="javascript:void(0);" class="ng-chat-title shadowed" (click)="onChatTitleClicked($event)">
<span>
Farmer List
</span>
</a>
<input *ngIf="!isCollapsed" id="ng-chat-search_friend" type="search" placeholder="Search" [(ngModel)]="search" (ngModelChange)="getFarmerBySearchVal(search)"
/>
<ul id="ng-chat-users" *ngIf="!isCollapsed">
<li *ngFor="let user of farmers">
<div *ngIf="!user.imageUrl" class="icon-wrapper">
<i class="user-icon"></i>
</div>
<img *ngIf="user.imageUrl" alt="" class="avatar" height="30" width="30" src="{{user.imageUrl}}"/>
<strong title="{{user.user}}" (click)="openChatWindow(user, true)">{{user.name}}</strong>
</li>
</ul>
</div>
</div>
<div class="col-md-9 m-l">
<div *ngFor="let user of userInfo; let i = index">
<div>
<app-chatwindow [userInfo]="user" (onWindowCloseNotify)="onWindowCloseDeleteUserFromList($event)"></app-chatwindow>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I have attached screenshot of desired output :
Parent component should be:
Child component should be:
Current output:
Consider this example.
Parent should be floated to the right, as well as the childrens.
.chat {
float: right;
list-style: none;
}
.chat li {
width: 160px;
height: 200px;
background: red;
float: right;
margin-left: 10px;
}
<ul class="chat">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>

Bootstrap navbar appears differently in Firefox and Chrome due to browser rendering inconsistencies

The screenshot below is my bootstrap navbar which works nicely (pills disappear one by one as per spec). However when scaled down to various screen sizes, the navbar is no longer in-line and becomes staggered.
The issue is worse in Chrome than in Firefox because the left hand section of the navbar does not sit at the top of the screen.
If I can get Chrome to look like the Firefox screenshot, this will help me fix the remaining issues.
Can anyone suggest which browser rendering inconsistency would explain why on the Chrome version, the left hand portion of the navbar does not sit flush with the top of the screen?
Top is Chrome, bottom is FireFox.
<header>
<div class="vr-nav-container" data-ng-controller="navBarController">
<div>
<div class="col vr-nav-col1">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top no-padding" role="navigation"'>
<a class='navbar-brand' href='/Default'>
<img height="30" class="logo" alt="Flatty" src="/Assets/images/logo-small-rocket-lg.png" />
<img height="30" id="xs-toggler" class="logo-xs" alt="Flatty" src="/Assets/images/logo_xs.png" />
</a>
</nav>
</div>
</div>
<div class="col vr-nav-col2 fill center">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top " role="navigation"'>
<div class="tabbable ">
<ul class="nav nav-pills contrast-background">
<li data-ng-repeat="item in NavBarViewModel">
<a href="{{item.Path}}"><i class="{{item.Icon}}"></i>
{{item.Title}}
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="col vr-nav-col3">
<div class="nowrap">
<nav class='navbar navbar-default navbar-static-top" role="navigation"'>
<ul class='nav'>
<li ng-controller="awardBoxController" class='dropdown medium only-icon widget'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
<i class='icon-trophy'></i>
<div class='label'>{{AwardSummary.TotalPoints}}</div>
</a>
<ul class='dropdown-menu'>
<li>
<div class="box-content box-statistic">
<h3 class="title text-error">{{AwardSummary.Level}}</h3>
<small>{{AwardSummary.TotalPoints}} points</small>
<div class="text-banana icon-trophy align-right"></div>
</div>
</li>
<li><a href="/#/Awards/My-Points/">
<div class='points-history box-content widget-body'>
<div class='pull-left icon'>
<i class='icon- text-banana'></i>
</div>
<div class='pull-left text'>
<span><strong>Point History</strong> <span class="see-all">- see all</span></span>
<small class='text-muted'>{{award.AcheivedDate}}</small>
</div>
</div>
</a></li>
<li ng-repeat="award in AwardSummary.Awards">
<a href='#'>
<div class=' box-content widget-body'>
<div class='pull-left icon'>
<i class='icon-{{award.Icon}} text-success'></i>
</div>
<div class='pull-left text'>
{{award.Name}}
<span class="text-muted">+{{award.Points}}</span>
<small class='text-muted'>{{award.AcheviedDate| fromNow}}</small>
</div>
</div>
</a>
</li>
<li class='divider'></li>
<li class='widget-footer'>
<a href='/#/Awards/High-Scores/'>High Scores</a>
</li>
</ul>
</li>
<li class='dropdown medium user-menu'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'>
<img width="23" height="23" src="/Assets/images/avatar.jpg" />
<span class='user-name'>
<asp:Literal ID="UserFirstNameLiteral" runat="server" meta:resourcekey="UserFirstNameLiteral">FirstName LastName</asp:Literal></span>
<b class='caret'></b>
</a>
<ul class='dropdown-menu'>
<li>
<a href='/UserAccount/UserProfile'>
<i class='icon-user'></i>
<%= this.GetGlobalResourceObject("MasterPage","Profile") %>
</a>
</li>
<li>
<a ng-if="ShowSettings" href='/Settings/Dashboard'>
<i class='icon-cog'></i>
<%= this.GetGlobalResourceObject("Resources","Settings") %>
</a>
</li>
<li>
<a ng-if="ShowSettings" href='http://todo.help.vr.zendeskurl.com'>
<i class='icon-bullhorn'></i>
<%= this.GetGlobalResourceObject("MasterPage","GetHelp") %>
</a>
</li>
<li class='divider'></li>
<li>
<form runat="server">
<asp:LinkButton ID="SignOutLinkButton" runat="server" OnClick="SignOutLinkButton_Click" meta:resourcekey="SignOutLinkButton">
<i class='icon-signout'></i> <%= this.GetGlobalResourceObject("Resources","SignOut") %>
</asp:LinkButton>
</form>
</li>
</ul>
</li>
</ul>
<div class='navbar-form navbar-right hidden-xs'>
<button class='btn btn-link dropdown-toggle' style="top: 4px;" name='button' data-toggle="dropdown" type='submit'><i class="icon-search"></i><span class="caret"></span></button>
<ul class="dropdown-menu">
<li>
<a category="" class="searchoption" href="#"><%= this.GetGlobalResourceObject("MasterPage","Everything") %></a>
</li>
<li class="divider"></li>
<li>
<a category="Deals" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Deals") %></a>
</li>
<li>
<a category="Contacts" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Contacts") %></a>
</li>
<li>
<a category="Accounts" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Accounts") %></a>
</li>
<li>
<a category="Tasks" class="searchoption" href="#"><%= this.GetGlobalResourceObject("Resources","Tasks") %></a>
</li>
</ul>
<div class='form-group'>
<input value="" id="searchBox" class="form-control" placeholder='<%= this.GetGlobalResourceObject("Resources","Search") %>...' autocomplete="off" id="q_header" name="q" type="text" />
</div>
</div>
</nav>
</div>
</div>
</div>
</div>
</header>
CSS
I am using the default bootstrap 3.0 CSS and have a seperate CSS file overriding some default CSS and adding my own
I had to do this because the pills section has to be in its own div in the centre column in order to work (disappear one by one and 'stack' as width decreases) and fill all the width between the left and right cols in the navbar.
.navbar-collapse:after {
clear: none;
}
.sorting, .sorting_asc, .sorting_desc {
background : none;
}
.top-buffer {
margin-top: 20px !important;
}
.removeclass{
font-size: 1.5em;
vertical-align: middle !important;
}
.removeclass:hover{
text-decoration: none;
}
.vr-navigation {
float: left;
width: 100%;
}
.rightnav {
float: right;
width: 285px;
margin-left: -160px;
}
.leftnav {
margin-right: 160px;
padding:0 10px;
width:auto;
height: 40px;
}
.nav-pills {
height: 40px;
}
.hidden-xs {
display: inline-block !important;
}
#media (max-width: 767px) {
.hidden-xs {
display: none!important;
}
}
.current {
font-weight: bold;
}
.nav-pills li a {
color: white;
}
.vr-nav-container
{
display: table;
}
.vr-nav-container > div
{
display: table-row;
}
.vr-nav-container > div > div
{
display: table-cell;
}
.vr-nav-container > div > div
{
padding: 0em;
}
.vr-nav-container .nowrap
{
white-space: nowrap;
}
.vr-nav-container .fill
{
margin: 0 auto;
}
.vr-nav-container .center
{
text-align: center;
}
.vr-nav-col1
{
/*background: red;*/
width: 5%;
min-width: 50px;
white-space: nowrap;
}
.vr-nav-col2
{
width: 50%;
margin: 0 auto;
/*background: yellow;*/
}
.vr-nav-col3
{
/*background: green;*/
width: 40%;
/*min-width: 260px;*/
}
.no-padding
{
padding-left: 0px !important;
padding-right: 0px !important;
}
.main-nav-closed #main-nav .navigation > .nav > li:hover > a.toggler-flyout > span
{
display: none;
}
/*.main-nav-closed #main-nav .navigation > .nav > li:hover > a.toggler-flyout > i
{
content: "\f061";
}*/

My dropkick plugin's dropdown looking strange

My dropkick look strange - http://i.imgur.com/0itAA.png
Container is bigger, than dropdown list.
My html:
<div class="text_over_field">
<b>Your language preferences</b>
<b>This is language you would like Print-it-Green service to be displayed in</b>
</div>
<div class="field">
<div class="dk_container dk_theme_default" id="dk_container_color" tabindex="7" style="display: block; ">
<a class="dk_toggle" style="width: 149px; ">
<span class="dk_label">English</span></a>
<div class="dk_options" style="top: 29px; ">
<ul class="dk_options_inner">
<li class="dk_option_current"><a data-dk-dropdown-value="">English</a></li>
<li class=""><a data-dk-dropdown-value="#E15A01">Israeli</a></li>
<li class=""><a data-dk-dropdown-value="#604A42">Ukrainian</a></li>
</ul>
</div>
</div>
</div>
<div class="submit" >
</div>
Check the CSS markup
Check the HTML markup
All is wrapped in form_for_new class.
Also, it crashed my form.
What you can say about it ?

<li> styling with css (chrome problems)

Hello I've got this weird problem with css.
I'm displaying an unordered list
<ul>
<li>
<div class='align-left'>
PMI
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='19' class="elim" name="19">
</div>
</li>
<li>
<div class='align-left'>
GRANDS COMPTES
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='21' class="elim" name="21">
</div>
</li>
<li>
<div class='align-left'>
associations
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='22' class="elim" name="22">
</div>
</li>
<li>
<div class='align-left'>
PME
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='25' class="elim" name="25">
</div>
</li>
<li>
<div class='align-left'>
ecoles privees
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='28' class="elim" name="28">
</div>
</li>
<li>
<div class='align-left'>
organisme
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='32' class="elim" name="32">
</div>
</li>
<li>
<div class='align-left'>
test
</div>
<div class='align-right'>
<img src="/img/delete_icon2.png" id='34' class="elim" name="34">
</div>
</li>
</ul>
now this is accompanied by these css rules:
.align-right{
float: right;
}
.align-left{
float: left;
}
On chrome, the bullet point from the list is actually UNDER the text for the bullet point.
Why did I do this, I want the images to be aligned from top down.
here are screenshots of the problem
thanks in advance.
the code you provided won't cause this problem.
Depending on what you want to do, adding
ul { list-style-type:none; }
or
ul li { padding-left:40px; }
may achieve desired effect.
edit
try adding overflow:hidden; to the li elements
I'd also personally do it like this:
li {
background:url(/img/delete_icon2.png) no-repeat center right;
padding-right:25px; /*might need to adjust */
}
<ul>
<li>PMI</li>
<li>Bla bla</li>
</ul>
no need to over-complicate things.
If you want the DIVS clickable you can just do
<li>PMI</li>
and CSS:
li a { display:block; width:xxx; height:xxx; }
as required.
Try playing with the list-style-position property. Options are inside and outside.
I had the same problem and it seems that you do not have exact control over the position of the default bullet point.
For me the following was working in Firefox and in IE, but in Chrome it is positioned inside the text:
<ul style="list-style-position: outside; margin:0; padding:0;">
<li />
<li />
</ul>
I needed to set margins and paddings for both the list and the list items to get the bullet point(disk) outside the text
<ul style="list-style-position: outside; margin:10px; padding:10px;">
<li style="padding: 10px 0 0 3px; margin-bottom: 8px;" />
<li style="padding: 10px 0 0 3px; margin-bottom: 8px;" />
</ul>
The strange part is, that if I set those bottom margins to anything less than 7 pixel, the bullets jump inside. 8px is the smallest working value, although there is lots of space around and between the elements (they move closer to each other fluently, only the bullet points start to jump).

Resources