ul.bs-pagination {
font-weight: 500;
height: 30px;
line-height: 30px;
margin: 0 2px;
min-width: 30px;
text-align: center;
align-items: center;
display: flex;
font-size: 18px;
}
ul.bs-pagination a {
padding: 0 10px;
border-radius: 5px;
color: #cc092f;
transition: 0.3s;
border: 1px solid transparent;
}
ul.bs-pagination a:hover {
border-color: #cc092f;
}
<nav class="bs-pagination__nav" aria-label="Paginação">
<ul class="bs-pagination">12<a href="p0/IZ7_819E19820H3TB0Q3I25JK808F2=CZ6_819E19820H3TB0Q3I25JK800I3=MKJTMIKw=GE=/#Z7_819E19820H3TB0Q3I25JK808F2"
title="Link para a página 3" id="pc1617018954514_linkToPage_3">3</a> </ul>
</nav>
The sequence 1 2 3 above is how it should be and the one below is like it should be ...
I have an html element, where I want to add a css customization to it, but it is not between span, it has no class and id. It is simply a text inside a div, can I style it?
Try to apply your styles directly to ul parameter and the next you can write separated styles for links.
ul.bs-pagination {color: red;} - it's for 1
ul.bs-pagination > a {color: blue;} - it's for 2 and 3
ul.bs-pagination {
font-weight: 500;
height: 30px;
line-height: 30px;
margin: 0px 2px;
min-width: 30px;
text-align: center;
align-items: center;
display: flex;
font-size: 18px;
}
ul.bs-pagination a {
padding: 0 10px;
border-radius: 5px;
color: #cc092f;
transition: 0.3s;
border: 1px solid transparent;
text-decoration: none;
}
ul.bs-pagination a:first-child {
margin-left: 10px;
}
ul.bs-pagination a:hover {
border-color: #cc092f;
}
<nav class="bs-pagination__nav" aria-label="Paginação">
<ul class="bs-pagination">123 </ul>
</nav>
Frankly speaking if you can't put your links inside <li> </li>, you should change your ul to div like below:
div.bs-pagination {
font-weight: 500;
height: 30px;
line-height: 30px;
margin: 0px 2px;
min-width: 30px;
text-align: center;
align-items: center;
display: flex;
font-size: 18px;
}
div.bs-pagination a {
padding: 0 10px;
border-radius: 5px;
color: #cc092f;
transition: 0.3s;
border: 1px solid transparent;
text-decoration: none;
}
div.bs-pagination a:first-child {
margin-left: 10px;
}
div.bs-pagination a:hover {
border-color: #cc092f;
}
<nav class="bs-pagination__nav" aria-label="Paginação">
<div class="bs-pagination">123 </div>
</nav>
Firstly, your HTML code is not correct. You are changing the semantics of HTML elements. The whole purpose of developing HTML is to describe the semantic element of the documents.
According to HTML Spec, the only children of ul element is li element.
<ul>
<li>Norway</li>
<li>Switzerland</li>
<li>United Kingdom</li>
<li>United States</li>
</ul>
Related
I am having difficulty aligning the divs in the middle of the page. Hence I have used absolute positioning to place them in the middle.But when I try to do media queries its difficult to place them in the middle. Please any help is appreciated.
nav>ul {
position: absolute;
top: 114px;
text-align: center;
;
}
nav>ul>li {
list-style: none;
float: left;
}
nav>ul>li>a {
text-decoration: none;
font-family: 'Abel', sans-serif;
color: #fff;
font-size: 18px;
font-weight: bold;
padding: 10px 45px 10px 45px;
background: #20639B;
border-left: 3px solid #34F532;
}
.color2 {
height: 0px;
border-bottom: 45px solid #20639B;
}
<div class="color2">
<div class="header">
<nav>
<ul>
<li> Privacy</li>
<li> Terms of Use</li>
<li>Copyright</li>
<li>Trademark</li>
<li>Logos</li>
<li>Pay Transparency</li>
</ul>
</nav>
</div>
</div>
You were close. Just remove position: absolute from nav>ul, and remove the float: left from nav>ul>li and replace it with display: inline-block.
nav>ul {
padding-top: 10px;
text-align: center;
}
nav>ul>li {
list-style: none;
display: inline-block;
}
nav>ul>li>a {
text-decoration: none;
font-family: 'Abel', sans-serif;
color: #fff;
font-size: 18px;
font-weight: bold;
padding: 10px 45px 10px 45px;
background: #20639B;
border-left: 3px solid #34F532;
}
.color2 {
height: 0px;
border-bottom: 40px solid #20639B;
}
<div class="color2">
<div class="header">
<nav>
<ul>
<li> Privacy</li>
<li> Terms of Use</li>
<li>Copyright</li>
<li>Trademark</li>
<li>Logos</li>
<li>Pay Transparency</li>
</ul>
</nav>
</div>
</div>
Flexbox can be one way to go. Here a quick JS Fiddle that shows you how you can achieve what you want: https://jsfiddle.net/58u76mrn/13/
nav {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: 100vw;
}
nav a {
text-decoration: none;
font-family: 'Abel',sans-serif;
color: #fff;
font-size: 18px;
font-weight: bold;
padding: 10px 45px 10px 45px;
background: #20639B;
border-left: 3px solid #34F532;
}
.color2 {
height: 0px;
}
Check this js fiddle
https://jsbin.com/geqovukozo/edit?css,output
nav{
position:absolute;
top:50%;
width:100%;
transform:translateY(-50%);
}
nav>ul {
text-align: center;
font-size:0;
}
nav>ul>li {
list-style: none;
display:inline-block;
}
nav>ul>li>a {
display:block;
text-decoration: none;
font-family: 'Abel', sans-serif;
color: #fff;
font-size: 18px;
font-weight: bold;
padding: 10px 45px 10px 45px;
background: #20639B;
border-left: 3px solid #34F532;
}
.color2 {
border-bottom: 45px solid #20639B;
}
Use positions with transform property in this case. and instead of float:left; use display:inline-block;
Is it possible to make a capsule shape using border-radius without a set width or height and include between delimeter?
Yes, You can try this way
.container {
width: 90%;
padding:20px;
margin: 10px auto;
background:#000;
}
ul {
list-style: none;
padding: 7px;
background: #333;
border-radius: 12px;
display: inline-flex;
}
li {
padding: 0 10px;
border-right: 1px solid #999;
line-height: 1;
color: #999;
font-size: 12px;
display: inline-block;
vertical-align: middle;
}
li:last-child {
border-right: none;
}
<div class="container">
<ul>
<li>abc</li>
<li>def</li>
<li>ghi</li>
</ul>
</div>
The links were all horizontally aligned until i put one of them in it's own div to change it's color when i'm on the page it is linking to.
Now i can't get him to go back in line.
<div class="navigation">
Mes productions
DJ
<a target="_blank" href="./CV.pdf">Mon CV</a>
<div id="contact">
Me contacter
</div>
</div>
.navigation {
padding: 40px 0px;
position: relative;
text-align: center;
width: 100%;
font-size: 30px;
}
.navigation a {
background: black;
border: 1px solid grey;
border-radius: 7px;
color: white;
display: inline-block;
margin: 100px 35px;
padding: 14px;
text-decoration: none;
opacity: 0.75;
font-family: impact;
}
.navigation a:hover {
background: white;
border: 1px solid black;
color: black;
}
#contact a {
background: white !important;
color: black !important;
display: inline-block !important;
}
You need to set display: inline-block on #contact, not #contact a.
I have a strange problem, i have 3 tab menu items, that have text,after text i set up border-bottom, it's working fine for first-menu tab, but for other 2 it's appears over another border-bottom, but when i put code in Jsfiddle it's works correctly.. Here is my code Jsfiddle
HTML
<div class="container">
<div class="row">
<div class="col-md-12">
<header>
<h1 class="title">Title▲</h1>
</header>
<div class="menu-nav">
<nav class="subnav">
<ul class="tabs">
CSS
body {
background-color: #E5E5E5;
}
a:link{
text-decoration:none !important;
}
.title{
margin-top: 150px;
font-size: 450%;
font-weight: bold;
letter-spacing: 3px;
margin-left: 10px;
border-bottom: 1px solid #ccc;
}
.title a,
.title a:visited,
.title a:link {
color: black;
}
.title a:hover,
.title a:link {
text-decoration: none;
color: #2bb673;
}
#show-about-btn {
font-size: 40%;
margin-left: 10px;
color: #2bb673;
}
/*Navigation*/
.subnav {
height: 80px;
line-height: 3em;
border-bottom: 1px solid #ccc;
}
.subnav li {
list-style: none;
float: left;
padding: 1px 40px 1px 1px;
}
.subnav ul li a.active {
padding: 6px;
background-color: #2bb673;
color: #fff;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
-o-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
}
.subnav li a {
color: #2bb673;
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
position: relative;
right: 30px;
}
.subnav a:hover {
text-decoration: none;
color: black;
-webkit-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
-o-transition: all .3s ease-in;
transition: all .3s ease-in;
}
article {
font-size: 16px;
font-family: arial, sans-serif;
display: block;
border-bottom: 1px solid #ccc;
}
.tab {
position: relative;
top: 12px;
font-size: 12px;
}
.menu-nav {
display: none;
}
.tab p,h5{
padding-bottom: 25px;
}
.tab h4 {
margin-top: 5px;
font-weight: bold;
}
.tab h5 {
font-size:18px;
}
.tab img {
margin-left: 50px;
margin-bottom: 10px;
}
/*Content*/
.our-work a {
font-family: "Literaturnaya Italic";
font-style: italic;
font-weight: 400;
font-size: 46px;
margin-top: 5px;
color: black;
}
At first screen border is in correct place
At the second tab, this same border appears over another
just add class row to #about_us or better wrap your code under #about_us inside a <div class="row">..content under #about_us..</div>. Bootstrap grid system classes like .col-md-3 should always be wrapped inside .row to avoid CSS float problem
Mechanism
grid classes starting with .col- use float:left to get aligned one after other and maintain precise dimensions. So its parent will lose all height (a classic CSS float problem). Now adding class row resolves this cleanly with adding a clearfix because it adds a pseudo element with clear:both.
.row:after {
content: " ";
clear:both;
display:block;
}
Your issue is you have multiple styles as #pankajPhartiyal said.
remove this line from border-bottom: 1px solid #ccc; from article{} in styles section
Demo
I have this JsFiddle, and I can not figure out why the buttons extend outside of the divs.
How can I get them to be inside of the divs?
Here is the CSS
.btn-link {
font-variant: small-caps;
text-decoration: none;
font-size: 1.2em;
padding: 8px 15px 12px 15px;
border-radius: 3px;
background-color: #7dc36b;
color: #ffffff;
}
div.left-nav {
float: left;
width: 200px;
}
div.left-nav > div {
clear: both;
width: 100%;
border: solid 1px red;
}
Here is the HTML:
<div class="left-nav">
<div>new story
</div>
<div>My Stories
</div>
</div>
You can specify display:inline-block; on the buttons, so the div expands to hold the anchors completely.
.btn-link {
font-variant: small-caps;
text-decoration: none;
font-size: 1.2em;
padding: 8px 15px 12px 15px;
border-radius: 3px;
background-color: #7dc36b;
color: #ffffff;
display:inline-block;
}
Fiddle
div.left-nav > div {
overflow: auto; /* removed clear: both; */
width: 100%;
border: solid 1px red;
}
div.left-nav > div > a {
display: inline-block;
}
http://jsfiddle.net/ZjvZu/10/
Hey hope this works for you : -
demo
<div class="left-nav">
<div class="btn">new story
</div>
<div class="btn">My Stories
</div>
CSS:-
.btn-link {
font-variant: small-caps;
text-decoration: none;
font-size: 1.2em;
padding: 8px 15px 8px 15px;
border-radius: 3px;
background-color: #7dc36b;
color: #ffffff;
}
div.left-nav {
float: left;
width: 200px;
}
div.left-nav > div {
clear: both;
width: 100%;
border: solid 1px red;
}
.btn{
padding:8px 15px 8px 15px;
}