I made this navigation bar using flexbox, but I want the right side buttons to be on the extreme right.
Here's my code : https://codepen.io/mayankkamboj/pen/XKbdOY
HTML:
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400' rel='stylesheet' type='text/css'>
<nav>
<div class='container'>
<div class='nav-btn hoverback'>
<img src='https://upload.wikimedia.org/wikipedia/commons/6/69/Airbnb_Logo_B%C3%A9lo.svg' />
</div>
<div class='nav-btn no-border'>
<i class="fa fa-search fa-2x" aria-hidden="true"></i>
<input type='text' placeholder='Where to ?' class='search'/>
</div>
</div>
<div class='container'>
<div class='nav-btn hoverback'>
<div class='btn b-a-host'>Become a Host</div>
</div>
<div class='nav-btn hoverback'>
Help
</div>
<div class='nav-btn hoverback'>
Sign Up
</div>
<div class='nav-btn hoverback'>
Log In
</div>
</div>
</nav>
CSS:
*{
box-sizing:border-box;
}
body{
padding:0;
margin:0;
}
nav{
border-bottom:1px solid #ddd;
font-family:'Roboto';
display:flex;
justify-content:space-between;
font-weight:300;
}
nav:after{
content:" ";
display:block;
clear:both;
height:0.01px;
}
.container{
display:flex;
}
.nav-btn{
height:4em;
padding:0em 1em;
border-right:1px solid grey;
display:flex;
min-width:100px;
justify-content:center;
align-items:center;
}
.no-border{
border-right:0px solid white;
}
img{
height:60%;
}
.fa{
color:#ccc;
}
nav .search{
height:4.5em;
width:20em;
font-family:'Roboto';
font-weight:400;
border-style:none;
text-indent:1em;
}
nav .search:focus{
outline-style:none;
}
nav .btn{
font-weight:400;
color:grey;
border:2px solid #aaa;
padding:0.5em 0.7em;
letter-spacing:0.01em;
}
.b-a-host{white-space:nowrap;}
.nav-btn.hoverback:hover{
cursor:pointer;
background-color:#f8f8f8;
}
#media (max-width:500px){
nav{
flex-direction:column;
}
}
It looks fine on mobile screens but causes a problem on higher resolutions. I want the buttons to be on the extreme sides with space in between them. How do I do it?
You don't need a clearfix here as you are dealing with flexboxes and not floating containers - so you can remove nav:after.
The issue is that the nav:after is a flex item and justify-content: space-around will consider that too - see demo below after removing the nav:after:
* {
box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
}
nav {
border-bottom: 1px solid #ddd;
font-family: 'Roboto';
display: flex;
justify-content: space-between;
font-weight: 300;
}
/*
nav:after {
content: " ";
display: block;
clear: both;
height: 0.01px;
}
*/
.container {
display: flex;
}
.nav-btn {
height: 4em;
padding: 0em 1em;
border-right: 1px solid grey;
display: flex;
min-width: 100px;
justify-content: center;
align-items: center;
}
.no-border {
border-right: 0px solid white;
}
img {
height: 60%;
}
.fa {
color: #ccc;
}
nav .search {
height: 4.5em;
width: 20em;
font-family: 'Roboto';
font-weight: 400;
border-style: none;
text-indent: 1em;
}
nav .search:focus {
outline-style: none;
}
nav .btn {
font-weight: 400;
color: grey;
border: 2px solid #aaa;
padding: 0.5em 0.7em;
letter-spacing: 0.01em;
}
.b-a-host {
white-space: nowrap;
}
.nav-btn.hoverback:hover {
cursor: pointer;
background-color: #f8f8f8;
}
#media (max-width:500px) {
nav {
flex-direction: column;
}
}
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400' rel='stylesheet' type='text/css'>
<nav>
<div class='container'>
<div class='nav-btn hoverback'>
<img src='https://upload.wikimedia.org/wikipedia/commons/6/69/Airbnb_Logo_B%C3%A9lo.svg' />
</div>
<div class='nav-btn no-border'>
<i class="fa fa-search fa-2x" aria-hidden="true"></i>
<input type='text' placeholder='Where to ?' class='search' />
</div>
</div>
<div class='container'>
<div class='nav-btn hoverback'>
<div class='btn b-a-host'>Become a Host</div>
</div>
<div class='nav-btn hoverback'>
Help
</div>
<div class='nav-btn hoverback'>
Sign Up
</div>
<div class='nav-btn hoverback'>
Log In
</div>
</div>
</nav>
You can add a class to the another container and make it justify-content: flex-end and more over please add flex:1 to container so that both container can have same width and remove clearfix. i hope it is helpful to you
*{
box-sizing:border-box;
}
body{
padding:0;
margin:0;
}
nav{
border-bottom:1px solid #ddd;
font-family:'Roboto';
display:flex;
justify-content:space-between;
font-weight:300;
}
.container{
display:flex;
flex: 1;
}
.container.right {
justify-content: flex-end;
}
.nav-btn{
height:4em;
padding:0em 1em;
border-right:1px solid grey;
display:flex;
min-width:100px;
justify-content:center;
align-items:center;
}
.no-border{
border-right:0px solid white;
}
img{
height:60%;
}
.fa{
color:#ccc;
}
nav .search{
height:4.5em;
width:20em;
font-family:'Roboto';
font-weight:400;
border-style:none;
text-indent:1em;
}
nav .search:focus{
outline-style:none;
}
nav .btn{
font-weight:400;
color:grey;
border:2px solid #aaa;
padding:0.5em 0.7em;
letter-spacing:0.01em;
}
.b-a-host{white-space:nowrap;}
.nav-btn.hoverback:hover{
cursor:pointer;
background-color:#f8f8f8;
}
#media (max-width:500px){
nav{
flex-direction:column;
}
}
<nav>
<div class='container'>
<div class='nav-btn hoverback'>
<img src='https://upload.wikimedia.org/wikipedia/commons/6/69/Airbnb_Logo_B%C3%A9lo.svg' />
</div>
<div class='nav-btn no-border'>
<i class="fa fa-search fa-2x" aria-hidden="true"></i>
<input type='text' placeholder='Where to ?' class='search'/>
</div>
</div>
<div class='container right'>
<div class='nav-btn hoverback'>
<div class='btn b-a-host'>Become a Host</div>
</div>
<div class='nav-btn hoverback'>
Help
</div>
<div class='nav-btn hoverback'>
Sign Up
</div>
<div class='nav-btn hoverback'>
Log In
</div>
</div>
</nav>
Related
I have a problem with my stupid and awful code.(HTML&CSS)
It's a copy of Airbnb's top page to study.
reference: https://www.airbnb.jp/host/homes?_set_bev_on_new_domain=1568702785_MTQxMDA4ZDc4ZmM0
1.header-width
Somehow, My header-size of width is very short.
I make it become longer the width of this site to 1050px.
so the [header-right] has to become align right.
2.footer positon
My footer stands around the center of the site somehow.
3.the position of picture
In the div class[host-voice-wrapper],
there is a picture(Emma) in the bottom.
But I want it to be the right of sentences.
1.check the original source code of Airbnb
1.
~HTML~
-----------
<header>
<div class="header-left">
<div class="header-logo">
<img src="./img/246x0w.jpg">
</div>
<div class="header-list">
<ul>
<li>概要</li>
<li>準備</li>
<li>安全</li>
<li>マネープラン</li>
</ul>
</div>
</div>
-----------
~CSS~
-----------
header{
height:60px;
padding: 10px 20px;
position:fixed;
z-index:10;
background-color: white;
}
.header-left{
float:left;
display:flex;
}
.header-logo img{
width:50px;
}
.header-list li{
float:left;
padding-right:30px;
font-weight:bold;
}
.header-list li:hover{
border-bottom:1px solid #7f7f7f;
}
.header-right{
float:right;
}
.expect-income{
}
.amount{
font-size:25px;
font-weight:bold;
}
.start{
padding:10px 15px;
background-color:#dc143c;
color:white;
border-radius:5px;
margin:10px;
}
.start:hover{
cursor:pointer;
transition:0.3s;
}
-----------
2.
~HTML~
-----------
<footer>
<img class="footer-logo" src="./img/246x0w.jpg">
<a>
Airbnb Global Services Limited
観光庁長官(01)第S0001号(2018年6月15日-2023年6月14日)
© 2019 Airbnb, Inc. All rights reserved.</a>
</footer>
-----------
~CSS~
-----------
footer{
height:40px;
border-top:1px solid #808080;
padding:10px 0 30px 20px;
}
.footer-logo{
width:20px;
}
footer a{
font-size:15px;
}
-----------
3.
~HTML~
-----------
<div class="host-voice-wrapper">
<div class="container">
<div class="contents">
<div class="voice">
<i class="fas fa-quote-left fa-2x my-orange"></i>
<br></br>
<a class="voice-text">「ホスト保証」があったからAirbnb参加を決めたといっても過言でないほどで、被害やトラブルがあったときに頼れるサポートがあるのは本当にありがたいですね。</a>
<br>
<a class="host-introduce">Emmaさんはロンドンのホスト。自由度の高さに魅力を感じています</a>
<br>
<a class="btn example">ホスト実践例をチェック</a>
</div>
<div class="Emma">
<img src="./img/Emma.jpg">
</div>
</div>
-----------
~CSS~
-----------
.host-voice-wrapper{
margin-top:100px;
}
.contents{
float:left;
}
.voice{
width:40%;
}
.voice-text{
font-size:30px;
}
.host-introduce{
color:#808080;
}
.example{
padding:15px 20px;
border:2px solid #404040;
border-radius:5px;
margin-top:20px;
}
.Emma{
width:400px;
}
-----------
Can you please check this code. hope it will work for you.
body {
margin: 0px;
padding: 80px 0px;
}
.container {
width: 1170px;
margin: 0 auto;
padding: 0px 15px;
}
header {
height: 60px;
padding: 10px 20px;
position: fixed;
left: 0;
top: 0;
width: 100%;
;
z-index: 10;
background-color: white;
}
.header-left {
float: left;
display: flex;
}
.header-logo img {
width: 50px;
}
.header-list li {
float: left;
padding-right: 30px;
font-weight: bold;
}
.header-list li:hover {
border-bottom: 1px solid #7f7f7f;
}
.header-right {
float: right;
}
.amount {
font-size: 25px;
font-weight: bold;
}
.start {
padding: 10px 15px;
background-color: #dc143c;
color: white;
border-radius: 5px;
margin: 10px;
}
.start:hover {
cursor: pointer;
transition: 0.3s;
}
footer {
height: 40px;
}
.footer-logo {
margin-right: 10px;
width: 20px;
}
footer a {
font-size: 15px;
}
.host-voice-wrapper {
padding: 80px 0px;
}
.footer-content {
border-top: 1px solid #808080;
padding: 10px 0 20px;
}
.footer-content,
.contents {
display: flex;
display: -webkit-flex;
align-items: center;
}
.voice {
width: 40%;
}
.voice-text {
font-size: 30px;
}
.host-introduce {
color: #808080;
}
.example {
padding: 15px 20px;
border: 2px solid #404040;
border-radius: 5px;
margin-top: 20px;
display: inline-block;
}
.Emma {
width: 50%;
text-align: center;
}
<header>
<div class="header-left">
<div class="header-logo">
<img src="https://image.shutterstock.com/image-illustration/logo-g-letter-on-white-260nw-497276758.jpg">
</div>
<div class="header-list">
<ul>
<li>概要</li>
<li>準備</li>
<li>安全</li>
<li>マネープラン</li>
</ul>
</div>
</div>
</header>
<div class="host-voice-wrapper">
<div class="container">
<div class="contents">
<div class="voice">
<i class="fas fa-quote-left fa-2x my-orange"></i>
<br></br>
<a class="voice-text">「ホスト保証」があったからAirbnb参加を決めたといっても過言でないほどで、被害やトラブルがあったときに頼れるサポートがあるのは本当にありがたいですね。</a>
<br>
<a class="host-introduce">Emmaさんはロンドンのホスト。自由度の高さに魅力を感じています</a>
<br>
<a class="btn example">ホスト実践例をチェック</a>
</div>
<div class="Emma">
<img src="https://image.shutterstock.com/image-illustration/logo-g-letter-on-white-260nw-497276758.jpg">
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<div class="footer-content">
<img class="footer-logo" src="https://image.shutterstock.com/image-illustration/logo-g-letter-on-white-260nw-497276758.jpg">
<a>
Airbnb Global Services Limited <br>
観光庁長官(01)第S0001号(2018年6月15日-2023年6月14日) <br>
© 2019 Airbnb, Inc. All rights reserved.
</a>
</div>
</div>
</footer>
I effectively have one goal in mind:
The ".hours" div should be centered and BELOW the two divs (.phone and .mail) which share the screen size equally.
so effectively:
.nav
.phone / .mail
.hours
\\\\\.footer/////
HOWEVER: Here is the tricky part... it shows up okay in Atom. Whenever I try to see it in Chrome though, it puts .hours before the .phone and .mail line...
Why?
Note: Just checked in Safari as well, and the same error is displayed. Thoughts?
* {
margin:0;
font-family: 'Roboto', sans-serif;
}
.topWrapper{
position: fixed;
top:0;
z-index:10;
width: 100%;
}
.header{
/*border: 1px solid rgb(0,0,0);*/
text-align: left;
width: 100%;
background-color: white;
height:75px;
position: relative;
top:0px;
}
#title{
padding-left: 10px;
padding-top: 10px;
font-size: 50px;
}
#contactBox{
position:fixed;
right:20px;
top:20px;
width:100px;
height:40px;
background-color: black;
color:white;
}
/*CONTACT US BUTTON = FTEXT*/
.fText{
font-size: 15px;
padding: 10px;
}
.nav{
height:50px;
width:100%;
border: 1px solid rgb(200,200,200);
background-color: white;
}
#nBar{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
li {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
padding: 15px 40px 10px 40px;
}
#home{
height:26px;
margin-top: 0px;
/*border: 1px solid black;*/
}
#bio{
height:26px;
margin-top: 0px;
/*border: 1px solid black;*/
}
#projects{
height:26px;
margin-top: 0px;
/*border: 1px solid black;*/
}
#contact{
height:26px;
margin-top: 0px;
/*border: 1px solid black;*/
}
#home:hover{
background-color: black;
color:white;
/*transition: 0.25s;*/
}
#bio:hover{
background-color: black;
color:white;
/*transition: 0.25s;*/
}
#projects:hover{
background-color: black;
color:white;
/*transition: 0.25s;*/
}
#contact:hover{
background-color: black;
color:white;
/*transition: 0.25s;*/
}
a{
text-decoration: none;
color:black;
}
/*body starts here*/
.contentWrap{
width:100%;
position:absolute;
top:135px;
z-index: 1;
}
.container{
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
min-width: 960px;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.phone{
width:48%;
height: 350px;
-webkit-box-ordinal-group:2;
-ms-flex-order:1;
order:1;
border-right: 1px solid rgb(200,200,200);
padding-left:10px;
/*padding-right: ;*/
}
.phone:hover{
background-color: rgb(208, 177, 202);
}
.phoneImg{
height:auto;
width:75%;
}
.mail{
width:47%;
height:350px;
-webkit-box-ordinal-group:2;
-ms-flex-order:1;
order:1;
padding-left: 10px;
}
.mail:hover{
background-color: rgb(208, 177, 202);
}
.mailImg{
height:auto;
width:75%;
}
/*hours is the entire hours div*/
.hours{
width:100%;
-webkit-box-ordinal-group:3;
-ms-flex-order:2;
order:2;
padding-bottom: 50px;
}
/*title of hours*/
.textHours{
padding-top: 10px;
text-align: center;
font-size: 50px;
}
/*available times*/
.timewindow{
text-align: center;
padding-top: 10px;
font-size: 20px;
}
/*the explanation of the time*/
.timeExp{
text-align: center;
padding:10;
}
.footer{
text-align: center;
width:100%;
-webkit-box-ordinal-group:4;
-ms-flex-order:3;
order:3;
height:65px;
border-top: 1px solid rgb(200,200,200);
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<meta name="description" content="Dockmann Web Services">
<meta name="keywords" content="HTML,CSS,JavaScript">
<meta name="author" content="Paul A">
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styleContact.css" />
<script src="jquery-3.1.1.min.js"></script>
type="text/javascript" src="scriptContact.js"></script>
<title>dockmann</title>
</head>
<body>
<div class="topWrapper">
<div class="header">
<h1 id="title">DOCKMANN</h1>
<a href="mailto:"><div id="contactBox">
<p class="fText">
Contact Us!
</p>
</div>
</a>
</div>
<div class="nav">
<ul id="nBar">
<!--inserted .navigation because it will help
differentiate the nav bar links when I add
other "<a> links" along the page -->
<a class="navigation" href=""><li id="home">
HOME
</li></a>
<a class="navigation" href=""><li id="bio">
BIO
</li></a>
<a class="navigation" href=""><li id="projects">
PROJECTS
</li></a>
<a class="navigation" href=""><li id="contact">
CONTACT
</li>
</a>
</ul>
</div>
</div>
<!-- body starts here -->
<div class="contentWrap">
<div class="container">
<div class="phone">
<center>
<a class="phoneLink" href="tel:">
<img class="phoneImg" src="images/phone.png" /></a>
</center>
</div>
<div class="mail">
<center>
<a class="mailLink" href="mailto:">
<img class="mailImg" src="images/mail.png" /></a>
</center>
</div>
<div class="Hours">
<h1 class="textHours">HOURS:</h1>
<h5 class="timewindow">9:00 (EST) - 21:00 (EST)</h5>
<p class="timeExp">
We normally pick up our phones during this time window.
<br />
However, it is okay to call afterhours.
<br />
(All times shown are shown in local Miami time)
</p>
</div>
<div class="footer">
footer;
</div>
</div>
</div>
</body>
</html>
Classes are case-sensitive, and you accidentally put class="Hours" in your HTML. Fix that and you'll see the CSS apply.
I am tinkering with FlexBox to design my site, and I am trying to apply these techniques to make a responsive and collapsable nav bar (ideally for mobile users). How can I achieve this? Apparently the flex commands in the .nbar class are not working.
*{
margin:0;
font-family: 'Roboto', sans-serif;
}
.wrapper{
width:100%;
min-width: 960px;
margin:0 auto;
/*display:flex;
align-items: flex-end;
this is just for the night vision button to position better
*/
}
.parent{
display:flex;
flex-wrap: wrap;
/*these two at the bottomr are optional to
center them on the page
max-width: 960px;
margin:0 auto;*/
max-width: 960px;
margin: auto;
}
/*WE MISSED THE .ONE SELECTOR*/
.one{
flex-grow: 1;
}
.title{
text-align: center;
position:relative;
font-size: 50px;
top:20px;
}
.header{
height:100px;
width:100%;
order:0;
border-bottom: 1px solid rgb(0,0,0);
}
.nav{
width:100%;
/*min-width: 900px;*/
height:40px;
border-bottom: 1px solid rgb(0,0,0);
order:1;
}
.banner{
width:100%;
min-width: 960px;
height:500px;
color:white;
background-color: rgb(0,0,0);
order:3;
}
.boxOne{
width:45%;
min-width: 200px;
height:300px;
border-right: 1px solid rgb(0,0,0);
order:4;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
border-left: 1px solid rgb(120,120,120);
text-align: justify;
}
.boxTwo{
width:45%;
min-width: 200px;
height:300px;
order:4;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
border-right: 1px solid rgb(120,120,120);
}
.footer{
width:100%;
height:100px;
border-top: 1px solid rgb(0,0,0);
border-bottom: 1px solid rgb(0,0,0);
border-right: 1px solid rgb(120,120,120);
border-left: 1px solid rgb(120,120,120);
order:5;
}
.nbar{
display:flex;
flex-wrap: wrap;
align-items: stretch;
flex-flow: wrap;
}
.two{
flex-grow: 0;
}
.home {
order:1;
}
.services {
order:2;
}
.testimonials {
order:3;
}
.portfolio {
order:4;
}
.contact {
order:5;
}
li {
display:inline-flex;
padding:10px 40px 10px 60px;
font-size: 15px;
}
a:link {
text-decoration: none;
color:black;
}
a:visited {
text-decoration: none;
color:black;
}
a:hover {
text-decoration: underline;
}
.disc{
padding-left: 5px;
padding-top: 5px;
font-size: 10px;
color: rgb(150,150,150);
}
.people{
overflow: hidden;
height:500px;
width:960px;
}
/*.popup {
background-color: white;
height: 20px;
width:90px;
border: 1px solid rgb(255, 0, 0);
position:fixed;
bottom:0;
}*/
<!DOCTYPE html>
<html>
<!-- dockmann -->
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div class="wrapper">
<div class="parent">
<div class="one header">
<p class="title">DOCKMANN</p>
</div>
<!-- end header -->
<div class="one nav">
<ul class="nbar">
<li class="two home">
HOME
</li>
<li class="two services">
SERVICES
</li>
<li class="two testimonials">
TESTIMONIALS
</li>
<li class="two portfolio">
PORTFOLIO
</li>
<li class="two contact">
CONTACT
</li>
</ul>
</div>
<!-- end nav -->
<div class="one banner">
<img class="people" src="image/macdesk.jpg" />
</div>
<!-- end banner -->
<div class="one boxOne">
<h2>Who we are...</h2>
<br />
Filler
</div>
<!-- end boxOne -->
<div class="one boxTwo">
boxTwo
</div>
<!-- end boxTwo -->
<div class="one footer">
<p class="disc">
filler
</p>
</div>
<!-- end footer -->
</div>
<!-- <button class="popup">
Night Vision!
</div> -->
</div>
</body>
</html>
Looks like removing min-width from .wrapper and removing min-height from .nav bar seems to fix the problem,
*{
margin:0;
font-family: 'Roboto', sans-serif;
}
.wrapper{
width:100%;
margin:0 auto;
/*display:flex;
align-items: flex-end;
this is just for the night vision button to position better
*/
}
.parent{
display:flex;
flex-wrap: wrap;
/*these two at the bottomr are optional to
center them on the page
max-width: 960px;
margin:0 auto;*/
margin: auto;
}
/*WE MISSED THE .ONE SELECTOR*/
.one{
flex-grow: 1;
}
.title{
text-align: center;
position:relative;
font-size: 50px;
top:20px;
}
.header{
height:100px;
width:100%;
order:0;
border-bottom: 1px solid rgb(0,0,0);
}
.nav{
width:100%;
/*min-width: 900px;*/
border-bottom: 1px solid rgb(0,0,0);
order:1;
}
.banner{
width:100%;
min-width: 960px;
height:500px;
color:white;
background-color: rgb(0,0,0);
order:3;
}
.boxOne{
width:45%;
min-width: 200px;
height:300px;
border-right: 1px solid rgb(0,0,0);
order:4;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
border-left: 1px solid rgb(120,120,120);
text-align: justify;
}
.boxTwo{
width:45%;
min-width: 200px;
height:300px;
order:4;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
border-right: 1px solid rgb(120,120,120);
}
.footer{
width:100%;
height:100px;
border-top: 1px solid rgb(0,0,0);
border-bottom: 1px solid rgb(0,0,0);
border-right: 1px solid rgb(120,120,120);
border-left: 1px solid rgb(120,120,120);
order:5;
}
.nbar{
display:flex;
flex-wrap: wrap;
align-items: stretch;
flex-flow: wrap;
}
.two{
flex-grow: 0;
}
.home {
order:1;
}
.services {
order:2;
}
.testimonials {
order:3;
}
.portfolio {
order:4;
}
.contact {
order:5;
}
li {
display:inline-flex;
padding:10px 40px 10px 60px;
font-size: 15px;
}
a:link {
text-decoration: none;
color:black;
}
a:visited {
text-decoration: none;
color:black;
}
a:hover {
text-decoration: underline;
}
.disc{
padding-left: 5px;
padding-top: 5px;
font-size: 10px;
color: rgb(150,150,150);
}
.people{
overflow: hidden;
height:500px;
width:960px;
}
/*.popup {
background-color: white;
height: 20px;
width:90px;
border: 1px solid rgb(255, 0, 0);
position:fixed;
bottom:0;
}*/
<!DOCTYPE html>
<html>
<!-- dockmann -->
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div class="wrapper">
<div class="parent">
<div class="one header">
<p class="title">DOCKMANN</p>
</div>
<!-- end header -->
<div class="one nav">
<ul class="nbar">
<li class="two home">
HOME
</li>
<li class="two services">
SERVICES
</li>
<li class="two testimonials">
TESTIMONIALS
</li>
<li class="two portfolio">
PORTFOLIO
</li>
<li class="two contact">
CONTACT
</li>
</ul>
</div>
<!-- end nav -->
<div class="one banner">
<img class="people" src="image/macdesk.jpg" />
</div>
<!-- end banner -->
<div class="one boxOne">
<h2>Who we are...</h2>
<br />
Filler
</div>
<!-- end boxOne -->
<div class="one boxTwo">
boxTwo
</div>
<!-- end boxTwo -->
<div class="one footer">
<p class="disc">
filler
</p>
</div>
<!-- end footer -->
</div>
<!-- <button class="popup">
Night Vision!
</div> -->
</div>
</body>
</html>
As my experience li tag does not work with flex-wrap therefor all of your 'li's
will stay in one line. If you want to solve your problem change this:
<ul class='nbar'>
<li>menu1</li>
<li>menu2</li>
</ul>
to this:
<div class='nbar'>
<div>menu1</div>
<div>menu2</div>
</div>
It will work. And please do not forget using -webkit- for flex properties because some of mobile browsers only works with this. For example:
display:-webkit-flex;
-webkit-flex-wrap: wrap;
I want to have 2 elements in a div but only one should be visible, and I want to have a vertical scrollbar.
Unfortunately, the second element is visible and there is no scrollbar.
#visu {
top:10px;
height:180px;
width:50%;
overflow:auto;
background-color:yellow;
}
#element1 {
position:absolute;
top:15px;
left:80px;
}
#element2 {
position:absolute;
top:200px;
left:80px;
}
.element {
margin-right:-50px;
}
.namecontainer {
display:flex;
border:4px solid #000033; border-radius:10px;
padding:10px; box-sizing:border-box;
background-color:white;
width:280px;
height:150px;
margin-left:0px;
align-items: center;
justify-content:center:
color:#1a1a1a;
}
.namecontainer p {
font-size:35px;
font-family: 'Arial';
font-weight:bold;
color:#1a1a1a;
text-align:center;
width:380px;
}
<div id="visu">
<div id="element1" class="element">
<div class="namecontainer">
<p class= "name" id="name1" >element 1</p>
</div>
</div>
<div id="element2" class="element">
<div class="namecontainer">
<p class= "name" id="name3" >element 2</p>
</div>
</div>
</div>
You need to play with margin and drop absolute positionnong cause it takes element off the flow and is not necessary here https://jsfiddle.net/vpdc5L4m/13/
#visu {
top: 10px;
height: 180px;
width: 50%;
overflow: auto;
background-color: yellow;
}
#element1 {}
#element2 {}
.element {
margin: 15px auto ;
}
.namecontainer {
display: flex;
border: 4px solid #000033;
border-radius: 10px;
padding: 10px;
box-sizing: border-box;
background-color: white;
width: 280px;
height: 150px;
margin:auto;
align-items: center;
justify-content: center: color: #1a1a1a;
}
.namecontainer p {
font-size: 35px;
font-family: 'Arial';
font-weight: bold;
color: #1a1a1a;
text-align: center;
width: 380px;
}
<div id="visu">
<div id="element1" class="element">
<div class="namecontainer">
<p class="name" id="name1">element 1</p>
</div>
</div>
<div id="element2" class="element">
<div class="namecontainer">
<p class="name" id="name2">element 2</p>
</div>
</div>
<div id="element3" class="element">
<div class="namecontainer">
<p class="name" id="name3">a third one ?</p>
</div>
</div>
</div>
To hide a CSS element, you can use
display: none;
So, I added a customized live tweet feature to the website, using something called 'twitter-post-fetcher, and I'm trying to get rid of this random bullet-point next to the live tweet. I tried adding it 'list-style'but that doesn't seem to be working.
Thanks in advance.
<!-- Custom CSS -->
<link href="css/customstyle.css" rel="stylesheet">
<style type="text/css">
.border{
border-right:1px solid #000;
}
footer{
margin-top: 300px;
}
.audio-peri-soc{
width:190%;
line-height: 45px;
}
.social-media{
display: block;
}
.unstyled{
list-style-type: none;
}
.border{
border-right:2px solid #ccc;
height:100px;
}
.col-lg-4{
width:30%;
list-style-type: none;
}
.compress .col-xs-9{
width: 200%;
padding-left: none;
}
.compress .col-xs-4{
padding-left:0;
}
.compress .col-lg-8 div{
margin:0;
padding: 0;
color:black;
font-size: 15px;
width:100%;
}
.blue{
color:#fff;
bottom:0;
margin-top:-10px;
margin-left: 10px;
font-size: 10px;
}
.compress{
width:100%;
margin: 0;
}
.twitter-fav-icon{
margin-left: 5px;
}
.compress p, a {
font-family:Arial,Sans-Serif;
font-size:13px;
color:black;
text-decoration:none;
margin: 0;
}
.compress ul li {
list-style:none;
overflow:hidden;
margin:50px;
padding:5px;
width:100%;
}
#example1{
margin-left: -40px;
padding: 0;
list-style-type: none;
}
.interact a{
margin: 0 0 0 5px;
padding: 0;
text-decoration: none;
}
.compress ul li:hover {
background-color:#fff;
}
.compress .user, .tweet, .timePosted {
float:none;
}
.compress a, a:visited {
color:#999;
}
.compress a:hover {
color:#ccc;
}
body{background:url('http://www.placehold.it/1200x800/cccccc/000000') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
margin: 0;}
.effect{
-moz-box-shadow: inset 0 0 10px #000000;
-webkit-box-shadow: inset 10px 100px 0 #000000;
box-shadow: inset 1px 0 10px #000000;
}
.col-md-7 p{
font-size:15px;
line-height: 230%;
text-align: justify;
width: 500px;
margin-top: -30px;
}
#footerSlideButton {
background-image:url('http://placehold.it/50x50');
background-repeat:none;
position: absolute;
top: -55px;
right: 20px;
width:50px;
height:50px;
border: none;
cursor: pointer;
}
.container .pull-left p{
margin: 0;
color:blue;
padding:0;
}
.navbar-fixed-bottom p{
margin: 20px;
font-size: 15px;
}
.navbar-fixed-bottom {
position: fixed;
bottom: -20px;
height: 0;
width: 100%;
background-color:#ffffff;
padding: 10px 0;
margin: 0;
}
#media (max-width:630px) {
ul{
color: blue;
}
}
</style>
</head>
<body>
<footer>
<div class="container" id="contact" name="contact">
<div class="row">
<br>
<h1 class="centered">THANKS FOR VISITING US</h1>
<hr>
<div class="col-lg-4">
<h3>Latest Tweets
</h3>
<div id="example1"></div>
<h4>Watch me on Periscope</h4>
<script>...</script>...
</div><!-- col -->
<div class="col-lg-4 border">
<form class="form-horizontal" role="form">
<div class="form-group">
</div>
</form><!-- form -->
</p>
</div><!-- col -->
<div class="col-lg-4">
<h3> Subscribe
</h3>
<div id="example1"></div>
<p>Subscribe for the latest newsletters and updates</p>
<div id="mc_embed_signup" class="mailchimp">
<div class="form-group">
<input type="email" value="" name="EMAIL" class="required email form-control" id="mce-EMAIL" placeholder="Enter email">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn btn__bottom--border mailchimp__btn" data-style="shrink" data-horizontal>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div class="" style="position: absolute; left: -5000px;"><input type="text" name="..." value=""></div>
</form>
<span class="form_nospam">No spam</span>
</div><!--End mc_embed_signup-->
</div><!-- col -->
</div><!-- row -->
</div><!-- container -->
<hr class="container">
<div class="container">
<i class="fa fa-facebook fa-2x"></i>
<i class="fa fa-twitter fa-2x"></i>
<i class="fa fa-soundcloud fa-2x"></i>
<div class="pull-right">
<iframe width="60%" height="20" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/226657681&color=999999&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false"> </iframe>
</div>
</div>
</footer>
</body>
</html>
Assuming you want no bullet points at all.
* {
list-style-type: none;
}