Hey I'm having some issues with my mega menu. Im trying to mimic Newegg's style. I want a small sub menu to show up on hover. Here is my codepen: https://codepen.io/iamgonge/pen/vxEEeN
I'm trying to make the sub menu line up with the caret in each menu link. right now it stays in the same spot,When I change it from Absolute it pushes everything down on hover.
/* Body */
body {
margin: 0px;
padding: 0px;
font-family: Helvetica;
background-color: #fff;
}
header {
min-height: 450px;
}
header.dd-blue {
background-color: #fff;
}
/* Nav */
nav {
position: relative;
}
header.dd-blue nav {
background-color: #4F96BA;
}
ul.main-nav {
list-style-type: none;
padding: 0px;
font-size: 0px;
max-width: 1000px;
margin: 0 auto;
}
ul.main-nav h2 {
font-size: .9em;
font-weight: 300;
}
ul.main-nav>li {
display: inline-block;
padding: 0;
}
ul.main-nav>li>a {
display: block;
padding: 20px 30px;
position: relative;
color: #fff;
font-size: 15px;
font-weight: 400;
box-sizing: border-box;
}
ul.main-nav>li:hover {
background-color: #f9f9f9;
}
ul.main-nav>li:hover>a {
color: #333;
font-weight: 400;
}
ul.main-nav>li ul.sub-menu-lists {
margin: 0px;
padding: 1px;
list-style-type: none;
display: block;
}
ul.main-nav>li ul.sub-menu-lists>li {
padding: 0 0px;
margin-top: 2px;
}
ul.main-nav>li ul.sub-menu-lists>li>a {
font-size: .84em;
font-weight: 500;
}
.sub-menu-head {
margin: 10px 0;
border-bottom: 1px solid #4F96BA;
width: 100%;
}
#media only screen and (min-width: 769px) {
/* Desktop */
ul.main-nav {
display: block;
position: relative;
}
.sub-menu-block {
padding: 15px;
}
/* Sub-menu */
ul.main-nav>li>div.sub-menu-block {
visibility: hidden;
background-color: #f9f9f9;
position: absolute;
margin-top: 0px;
width: 100%;
color: #333;
left: 0;
box-sizing: border-box;
z-index: 3;
font-size: 16px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
opacity: 0;
/*CSS animation applied for sub menu : Slide from Top */
-webkit-transition: all 0.4s ease 0s;
-o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s;
-webkit-transform: rotateX(90deg);
-moz-transform: rotateX(90deg);
-ms-transform: rotateX(90deg);
transform: rotateX(90deg);
-webkit-transform-origin: top center;
-ms-transform-origin: top center;
transform-origin: top center;
}
ul.main-nav>li:hover>div.sub-menu-block {
background-color: #fff;
visibility: visible;
opacity: 1;
-webkit-transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
transform: rotateX(0deg);
}
ul.main-nav>li>div.sub-menu-block>* {
-webkit-transition-property: opacity;
-moz-transition-property: opacity;
-o-transition-property: opacity;
transition-property: opacity;
-webkit-transition-duration: 0.4s;
-moz-transition-duration: 0.4s;
-o-transition-duration: 0.4s;
transition-duration: 0.4s;
opacity: 0;
}
ul.main-nav>li:hover>div.sub-menu-block>* {
opacity: 1;
}
.sub-menu-head {
font-size: 20px;
}
header.dd-blue ul.main-nav>li>a {
border-right: 1px solid #666;
}
/* List Separator: Inner Border */
ul.main-nav>li>a:after {
content: '';
width: 1px;
height: 62px;
position: absolute;
right: 0px;
top: 0px;
z-index: 2;
}
header.dd-blue ul.main-nav>li>a:after {
background-color: #999;
}
/* Drop Down/Up Arrow for Mega Menu */
ul.main-nav>li>a.mega-menu>span {
display: block;
vertical-align: middle;
}
ul.main-nav>li>a.mega-menu>span:after {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #fff;
content: '';
background-color: transparent;
display: inline-block;
margin-left: 10px;
vertical-align: middle;
}
ul.main-nav>li:hover>a.mega-menu span:after {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 0px solid transparent;
border-bottom: 5px solid #666;
}
}
.sub-menu-lists li {
line-height: 1;
}
/* 5 Columns */
.col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-15 {
width: 20%;
float: left;
}
#media (min-width: 768px) {
.col-sm-15 {
width: 20%;
float: left;
}
}
#media (min-width: 992px) {
.col-md-15 {
width: 20%;
float: left;
}
}
#media (min-width: 1200px) {
.col-lg-15 {
width: 20%;
float: left;
}
}
/* end 5 columns */
#rds-font {
font-size: 15px;
}
a, a:active, a:visited, a:link {
color: #599ab9;
text-decoration: none;
}
a:hover {
color: black;
}
#left-border {
border-left: 1px solid #666;
}
/* Hover dropdown */
.dropdown ul.dropdown-menu {
margin-top: 0;
}
.hover_drop_down:hover ul.dropdown-menu {
margin-top: 2px;
}
.hover_drop_down:hover ul.dropdown-menu {
display: inline-block;
position: absolute;
top: 25px;
left: 90%;
z-index: 1;
}
.dropdown-menu>li>a {
display: block;
margin: 10px: padding-bottom: 10px;
font-size: 13px;
font-weight: 500;
line-height: 1;
color: #599ab9;
}
<header class="dd-blue">
<nav role="navigation">
<ul class="main-nav">
<li class="top-level-link">
<a class="mega-menu" id="left-border"><span>Main 1</span></a>
<div class="sub-menu-block">
<div class="row">
<div class="col-xs-15">
<h2 class="sub-menu-head">Header 1</h2>
<ul class="sub-menu-lists">
<li class="hover_drop_down">
Item with sub-menu<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Item X</li>
</ul>
</li>
<li class="hover_drop_down">
Item with sub-menu<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Item X</li>
</ul>
</li>
</ul>
</div>
</div>
</div> <!--end of sub-menu-block -->
</li>
</ul>
</nav>
</header>
Set position: absolute; display: inline-block; and remove any left and top values so that the element will display where it is in the DOM.
/* Body */
body {
margin: 0px;
padding: 0px;
font-family: Helvetica;
background-color: #fff;
}
header {
min-height: 450px;
}
header.dd-blue {
background-color: #fff;
}
/* Nav */
nav {
position: relative;
}
header.dd-blue nav {
background-color: #4F96BA;
}
ul.main-nav {
list-style-type: none;
padding: 0px;
font-size: 0px;
max-width: 1000px;
margin: 0 auto;
}
ul.main-nav h2 {
font-size: .9em;
font-weight: 300;
}
ul.main-nav>li {
display: inline-block;
padding: 0;
}
ul.main-nav>li>a {
display: block;
padding: 20px 30px;
position: relative;
color: #fff;
font-size: 15px;
font-weight: 400;
box-sizing: border-box;
}
ul.main-nav>li:hover {
background-color: #f9f9f9;
}
ul.main-nav>li:hover>a {
color: #333;
font-weight: 400;
}
ul.main-nav>li ul.sub-menu-lists {
margin: 0px;
padding: 1px;
list-style-type: none;
display: block;
}
ul.main-nav>li ul.sub-menu-lists>li {
padding: 0 0px;
margin-top: 2px;
}
ul.main-nav>li ul.sub-menu-lists>li>a {
font-size: .84em;
font-weight: 500;
}
.sub-menu-head {
margin: 10px 0;
border-bottom: 1px solid #4F96BA;
width: 100%;
}
#media only screen and (min-width: 769px) {
/* Desktop */
ul.main-nav {
display: block;
position: relative;
}
.sub-menu-block {
padding: 15px;
}
/* Sub-menu */
ul.main-nav>li>div.sub-menu-block {
visibility: hidden;
background-color: #f9f9f9;
position: absolute;
margin-top: 0px;
width: 100%;
color: #333;
left: 0;
box-sizing: border-box;
z-index: 3;
font-size: 16px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
opacity: 0;
/*CSS animation applied for sub menu : Slide from Top */
-webkit-transition: all 0.4s ease 0s;
-o-transition: all 0.4s ease 0s;
transition: all 0.4s ease 0s;
-webkit-transform: rotateX(90deg);
-moz-transform: rotateX(90deg);
-ms-transform: rotateX(90deg);
transform: rotateX(90deg);
-webkit-transform-origin: top center;
-ms-transform-origin: top center;
transform-origin: top center;
}
ul.main-nav>li:hover>div.sub-menu-block {
background-color: #fff;
visibility: visible;
opacity: 1;
-webkit-transform: rotateX(0deg);
-moz-transform: rotateX(0deg);
-ms-transform: rotateX(0deg);
transform: rotateX(0deg);
}
ul.main-nav>li>div.sub-menu-block>* {
-webkit-transition-property: opacity;
-moz-transition-property: opacity;
-o-transition-property: opacity;
transition-property: opacity;
-webkit-transition-duration: 0.4s;
-moz-transition-duration: 0.4s;
-o-transition-duration: 0.4s;
transition-duration: 0.4s;
opacity: 0;
}
ul.main-nav>li:hover>div.sub-menu-block>* {
opacity: 1;
}
.sub-menu-head {
font-size: 20px;
}
header.dd-blue ul.main-nav>li>a {
border-right: 1px solid #666;
}
/* List Separator: Inner Border */
ul.main-nav>li>a:after {
content: '';
width: 1px;
height: 62px;
position: absolute;
right: 0px;
top: 0px;
z-index: 2;
}
header.dd-blue ul.main-nav>li>a:after {
background-color: #999;
}
/* Drop Down/Up Arrow for Mega Menu */
ul.main-nav>li>a.mega-menu>span {
display: block;
vertical-align: middle;
}
ul.main-nav>li>a.mega-menu>span:after {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #fff;
content: '';
background-color: transparent;
display: inline-block;
margin-left: 10px;
vertical-align: middle;
}
ul.main-nav>li:hover>a.mega-menu span:after {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 0px solid transparent;
border-bottom: 5px solid #666;
}
}
.sub-menu-lists li {
line-height: 1;
}
/* 5 Columns */
.col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-15 {
width: 20%;
float: left;
}
#media (min-width: 768px) {
.col-sm-15 {
width: 20%;
float: left;
}
}
#media (min-width: 992px) {
.col-md-15 {
width: 20%;
float: left;
}
}
#media (min-width: 1200px) {
.col-lg-15 {
width: 20%;
float: left;
}
}
/* end 5 columns */
#rds-font {
font-size: 15px;
}
a, a:active, a:visited, a:link {
color: #599ab9;
text-decoration: none;
}
a:hover {
color: black;
}
#left-border {
border-left: 1px solid #666;
}
/* Hover dropdown */
.dropdown ul.dropdown-menu {
margin-top: 0;
}
.hover_drop_down:hover ul.dropdown-menu {
position: absolute;
display: inline-block;
z-index: 1;
left: auto;
top: auto;
}
.caret-right {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-left: 5px solid;
border-left-color:#1c2b36;
border-bottom: 5px solid transparent;
border-top: 5px solid transparent;
}
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<header class="dd-blue">
<nav role="navigation">
<ul class="main-nav">
<li class="top-level-link">
<a class="mega-menu" id="left-border"><span>Main 1</span></a>
<div class="sub-menu-block">
<div class="row">
<div class="col-xs-15">
<h2 class="sub-menu-head">Header 1</h2>
<ul class="sub-menu-lists">
<li class="hover_drop_down">
Item with sub-menu<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Item X</li>
</ul>
</li>
<li class="hover_drop_down">
Item with sub-menu<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li>Item X</li>
</ul>
</li>
</ul>
</div>
</div>
</div> <!--end of sub-menu-block -->
</li>
</ul>
</nav>
</header>
Related
I'm new in css and I have pure hamburguer css menu
Problem is the menu is part of page as absolute item, I want it to float and show always when page scroll, the position is just bellow header
Desire result:
And when menu is open take space of page and show an icon at the bottom of menu:
Snippet:
*{
box-sizing: border-box;
}
body{
font-family: 'Montserrat', sans-serif;
margin:0px;
}
.section-title{
color: #2ddf5c;
}
.main-header{
display: flex;
align-items: center;
justify-content: space-evenly;
width:100%;
/* background: #2ddf5c; */
padding: 16px;
}
.main-header > div{
vertical-align: middle;
}
.main-header__brand{
color: #7B8F34;
text-decoration: none;
font-weight: bold;
font-size: 20px;
}
.main-nav__searchbar_container {
display: flex;
width: 100%;
padding: 8px 8px 8px 40px;
overflow: hidden;
vertical-align: middle;
white-space: nowrap;
}
.main-nav__searchbar_container input.main-nav__searchbar{
width:100%;
height: 50px;
/* background: #2b303b; */
border: none;
font-size: 10pt;
float: left;
/* color: #fff; */
padding-left: 15px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.main-nav__searchbar_container input.main-nav__searchbar::-webkit-input-placeholder{
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar:-moz-placeholder{ /*Frefox 18 */
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar::-moz-placeholder{/*Frefox 19 */
color: #65737e;
}
.main-nav__searchbar_container input.main-nav__searchbar:-ms-input-placeholder{
color: #65737e;
}
.main-nav__searchbar_container button.icon{
-webkit-border-top-right-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border: none;
background: #4f5b66;
height: 50px;
width: 50px;
color: #ffffff;
opacity: 0;
font-size: 10pt;
-webkit-transition: all .55s ease;
-moz-transition: all .55s ease;
-ms-transition: all .55s ease;
-o-transition: all .55s ease;
transition: all .55s ease;
}
.main-nav__searchbar_container:hover button.icon,
.main-nav__searchbar_container:active button.icon,
.main-nav__searchbar_container:focus button.icon{
outline: none;
opacity: 1;
margin-left: -50px;
}
.main-nav__searchbar_container:hover button.icon:hover{
background: red;
cursor: pointer;
}
input.main-nav__searchbar:hover{
border: 2px solid #4f5b66;
}
.main-nav__searchbar{
display: flex;
width: 100%;
/* margin: 8px; */
/* padding: 8px; */
border: 2px solid;
border-radius: 4px;
outline: none;
transition: .3s;
}
.main-nav{
display: flex;
width: 100%;
text-align: right;
margin: 0 10px;
}
.main-nav__items{
display: flex;
margin:8px;
padding:8px;
list-style: none;
}
.main-nav__item{
display: inline-block;
}
.main-nav__social{
display:block;
width: 35px;
height: 35px;
margin-left: 10px;
padding: 4px;
}
#main-slider {
width: 100%;
height: 528px;
/* border-radius: 0% 0% 50% 50% / 0% 0% 20% 20%; */
border-bottom-right-radius: 50% 25%;
border-bottom-left-radius: 50% 25%;
position: relative;
}
.badge {
background-color: #fff;
border-radius: 30px;
box-shadow: 0 15px 35px 0 rgba(42,51,83,.12), 0 5px 15px rgba(0,0,0,.06);
position: absolute;
margin-top: 0.5em;
}
.text {
padding: 0.5rem 0.25rem 0.5rem 1rem;
}
.link {
border-radius: inherit;
display: inline-block;
background-color: #7B8F34;
padding: 0.5rem 1rem;
color: #F9F9EC;
}
.slider-wrapper {
display: flex;
justify-content: center;
align-items: flex-end;
}
/* menu */
.main .menu {
clear: both;
/* max-height: 0; */
display: none;
transition: max-height .2s ease-out;
}
/* menu icon */
.main .menu-icon {
cursor: pointer;
float: right;
padding: 28px 20px;
position: relative;
user-select: none;
}
.main .menu-icon .nav-icon {
background: #333;
display: block;
height: 2px;
position: relative;
transition: background .2s ease-out;
width: 18px;
}
.main .menu-icon .nav-icon:before,
.main .menu-icon .nav-icon:after {
background: #333;
content: '';
display: block;
height: 100%;
position: absolute;
transition: all .2s ease-out;
width: 100%;
}
.main .menu-icon .nav-icon:before {
top: 5px;
}
.main .menu-icon .nav-icon:after {
top: -5px;
}
/* menu btn */
.main .menu-btn {
display: none;
}
.main .menu-btn:checked ~ .menu {
/* max-height: 240px; */
display: block;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon {
background: transparent;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon:before {
transform: rotate(-45deg);
top:0;
}
.main .menu-btn:checked ~ .menu-icon .nav-icon:after {
transform: rotate(45deg);
top:0;
}
#media (min-width: 48em) {
.main li a {
padding: 20px 30px;
}
.main .menu {
clear: none;
float: right;
max-height: none;
}
}
<header class="main-header">
<div>
<a href="index.html" class="main-header__brand">
uHost
</a></div><nav class="main-nav">
<div class=main-nav__searchbar_container><input type="text" placeholder="Search" class="main-nav__searchbar">
<button class="icon"><i class="fas fa-search" aria-hidden="true"></i></button>
</div>
<ul class="main-nav__items">
<li class="main-nav__item">
<img class="main-nav__social" src="navbar-icons/social-media__icons/facebook.svg" alt="facebook">
</li>
<li class="main-nav__item">
<img class="main-nav__social" src="navbar-icons/social-media__icons/instagram-bosquejado.svg" alt="instagram">
</li>
</ul>
</nav>
</header>
<div class="main">
<input class="menu-btn" type="checkbox" id="menu-btn" />
<label class="menu-icon" for="menu-btn"><span class="nav-icon"></span></label>
<ul class="menu">
<li>Test1</li>
<li>Test2</li>
<li>Test3</li>
</ul>
</div>
<main>
<section>
<div class="slider-wrapper">
<img id="main-slider" src="https://via.placeholder.com/1365x528?text=Slider">
</div>
</section>
Regards
I've been stuck for about a week on this and i really need help. Searched everywhere but to no avail. The problem i am facing is that my flex items get pushed horizontally when i open a dropdown-menu that's togglable from another item on the list. Screenshot describing the problem : http://imgur.com/H6FUf3o
I am using rails and react.
the header.html.erb
<nav data-behavior="animated-navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid col-md-10 col-md-offset-1">
<div class="navbar-header">
<%= link_to root_path, class: "navbar-brand", id: "logo" do %>
<%= image_tag('logo.png', width: 55) %>
<% end %>
</div>
<ul class="nav navbar-nav filter-links">
<li>
<% if user_signed_in? %>
<%= nav_link_to "Home", root_path %>
<% else %>
<%= nav_link_to "Staff pick", root_path %>
<% end %>
</li>
<li><%= nav_link_to "Top stories", top_stories_path %></li>
<% if user_signed_in? %>
<li><%= nav_link_to "Bookmarks", dashboard_bookmarks_path %></li>
<% else %>
<li>Bookmarks</li>
<% end %>
</ul>
<div class="folding-nav">
<ul class="nav navbar-nav navbar-right">
<li class="main-searchbar">
<%= react_component('SearchContainer') %>
</li>
<% if user_signed_in? %>
<li class="new-post-button"><%= link_to "Write a story", new_post_path, class: "button" %></li>
<li id="notifications">
<%= react_component('NotificationsContainer', {}) %>
</li>
<%= render 'layouts/avatar_dropdown' %>
<% else %>
<li class="new-post-button"><%= link_to "Write a story", new_post_path, class: "button", data: { behavior: 'trigger-overlay' } %></li>
<li class="sign-in-button"><%= link_to "Sign in / Sign up", new_user_session_path, class: 'button green-border-button', data: { behavior: 'trigger-overlay' } %></li>
<% end %>
</ul>
</div>
</div>
</nav>
the header.scss
body {
padding-top: 0;
}
.container-fluid, .container {
padding: 0;
}
.navbar-header {
padding: 8px 0;
border-bottom: 1px solid $super-light-gray;
}
.navbar-fixed-top {
position: relative;
}
.navbar-nav, .navbar-nav > li {
display: inline-block;
}
.navbar-nav {
margin: 5 10px;
}
.navbar-nav > .open > a {
background-color: $white !important;
}
.navbar-nav > li > a {
padding: 7px 24px;
}
/** Navbar animation **/
nav.navbar {
transition: 0.3s transform;
&.is-inView {
transform: translateY(0);
}
&.is-hidden {
transform: translateY(-100%);
}
}
.navbar-admin {
ul.nav.navbar-nav > li > a {
color: #fff;
border: none;
}
}
nav.navbar {
margin-bottom: 0;
border-radius: 0;
border-color: $super-light-gray;
&.navbar-default {
background-color: $greenlight;
}
.navbar-brand {
height: 40px;
}
.regular-nav {
color: $white;
}
.filter-links {
margin-left: 9px;
li > a {
text-decoration: none;
font-family: 'CaviarBI';
font-size: 18px;
color: $white;
font-weight: 400;
&.active {
font-size: 25px;
}
}
}
.folding-nav {
position: absolute;
top: 3px;
right: 0;
}
.navbar-right {
margin: 0;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-end;
align-content: stretch;
align-items: flex-start;
}
.navbar-right > li {
order: 0;
flex: 0 1 auto !important;
align-self: auto !important;
}
.new-post-button {
display: none;
}
.new-post-button a {
transition: all .1s;
color: $light-gray;
font-family: 'Caviar';
font-weight: 600;
background-color: $white;
}
.new-post-button:hover {
a {
color: $greenlight;
border-color: $border-hover-color;
background-color: $white;
}
}
.new-post-button,
.sign-in-button {
margin-top: 5px;
margin-right: 10px;
.button {
padding: 0.6em 1em 0.7em 1em;
}
}
.account {
padding-top: 5px;
}
a.avatar-wrapper {
padding: 0;
display: inline;
float:none;
margin: 3px 15px 0 10px;
}
a.avatar-wrapper img.avatar-image {
border: 1.5px solid $border-color;
transition: all .1s;
}
a.avatar-wrapper:hover img.avatar-image, .open a.avatar-wrapper img.avatar-image {
border: 1.5px solid $border-hover-color;
}
.nav-dropdown {
background: #fff;
#include border-radius($popover);
box-shadow: 0 1px 2px rgba(0,0,0,.25),0 0 1px rgba(0,0,0,.35);
border: none;
top: 134%;
right: 20px;
a {
color: $light-font-color;
&:hover {
background-color: $white;
color: rgba(0,0,0,0.8);
}
}
.nd-main {
font-size: 16px;
font-weight: 100px;
line-height: 1.4;
}
.nd-sub {
font-size: 14px;
font-weight: 100;
line-height: 1.4;
}
.dropdown-arrow-top {
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
z-index: 20;
border-bottom: 10px solid #fff;
position: absolute;
right: 10px;
top: -10px;
}
.dropdown-arrow-bottom {
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
z-index: 10;
border-bottom: 11px solid rgba(0, 0, 0, 0.11);
position: absolute;
right: 8px;
top: -11px;
}
}
#logo {
width: 128px;
margin-left: 15px;
img {
top: 5px;
height: 31px;
}
span {
right: 0;
text-transform: uppercase;
font-weight: bold;
}
}
}
/* Small devices (tablets, 768px and up) */
#media (min-width: $screen-sm-min) {
body {
padding-top: 67px;
}
.navbar-header {
border-bottom: none;
}
.navbar-fixed-top {
position: fixed;
}
nav.navbar {
padding: 5px 0;
.filter-links {
margin-top: 16px;
margin-left: 0;
}
#logo {
width: 138px;
margin-left: 0;
}
.new-post-button {
display: inline-flex;
}
}
}
/* Medium devices (desktops, 992px and up) */
#media (min-width: $screen-md-min) {
nav.navbar {
#logo {
width: 150px;
}
}
}
/* Large devices (large desktops, 1200px and up) */
#media (min-width: $screen-lg-min) {
}
#media (max-width: 767px){
.navbar-nav
.open .dropdown-menu {
background-color: $white;
box-shadow: 0 1px 2px rgba(0,0,0,.25),0 0 1px rgba(0,0,0,.35);
clear:both;
}
}
The dropdown-menu is for notifications, done with react. Here's what react renders :
render () {
return (
<div className="notification-container">
<a className={`dropdown-toggle ${this.state.newNotificationCount > 0 ? 'active' : ''}`}
onClick={() => this.handleMarkAsTouched()}
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
{this.renderNotificationIcon()}
</a>
<div
className="dropdown-menu"
ref={(ref) => {this.dropdownRef = ref}}
>
<span className="dropdown-arrow-top"></span>
<span className="dropdown-arrow-bottom"></span>
<div className="notification-header">
<span>Notifications</span>
<a className="pull-right mark-all-as-read"
onClick={(e) => this.handleMarkAllAsRead(e)}>
Mark All as Read
</a>
</div>
<ul
onScroll={() => this.handleScroll()}
ref={(ref) => {this.notificationsListRef = ref}}
className="notifications-list">
{this.renderNotificationItems()}
{this.loadMoreButton()}
</ul>
</div>
</div>
);
}
lastly the notifications.scss :
#notifications {
a.dropdown-toggle.active {
background-color: rgba($accent-color, 0.8);
}
a.dropdown-toggle {
display: inline-block;
width: 40px;
height: 40px;
padding: 0;
margin-top: 5px;
position: relative;
background-color: white;
border: 1.5px solid $border-color;
transition: all .1s;
#include border-radius($round);
i.fa-bell-o,
span#new-notifications-count {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 1.3em;
}
#bell {
color: $light-font-color;
}
span#new-notifications-count {
color: $white;
}
}
a.dropdown-toggle:hover {
border: 1.5px solid $border-hover-color;
#bell{
color: $greenlight;
}
}
}
.notification-container {
.dropdown-menu {
width: 360px;
margin-top: 9px;
}
.notification-header {
padding: 4px 20px;
border-bottom: 1px solid $light-border-color;
color: $font-black;
}
.mark-all-as-read {
cursor: pointer;
color: $light-font-color;
&:hover,
&:active {
color: $accent-color;
}
}
.notifications-list {
overflow: hidden;
overflow-y: scroll;
max-height: 440px;
list-style: none;
padding: 0;
}
.load-more {
text-align: center;
}
.dropdown-arrow-top {
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
z-index: 20;
border-bottom: 10px solid #fff;
position: absolute;
right: 10px;
top: -10px;
}
.dropdown-arrow-bottom {
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
z-index: 10;
border-bottom: 11px solid rgba(0, 0, 0, 0.11);
position: absolute;
right: 8px;
top: -11px;
}
}
.notifications-list {
.avatar-image {
margin-right: 18px;
vertical-align: baseline;
}
li {
padding: 8px 0;
border-bottom: 1px solid $light-border-color;
&.unread-notification {
border-left: 2px solid $accent-color;
}
}
li > a {
color: $light-font-color;
display: block;
padding: 3px 0 3px 20px;
clear: both;
white-space: nowrap;
font-weight: normal;
transition: color 200ms;
&:hover {
color: $font-black;
}
}
.notification-metadata {
display: inline-block;
}
.fa {
margin-right: 8px;
}
.fa-heart-o {
color: #e81c4f;
}
.fa-user {
color: lightblue;
}
.fa-commenting-o {
color: $light-font-color;
}
}
// Bell Animation for "No Notifications"
.no-notifications {
margin: 10px 11px 8px 10px;
padding: 10px;
text-align: center;
position: relative;
.speech-bubble {
border: $border-color 1px solid;
padding: 10px;
#include border-radius($radius);
width: 170px;
margin: 0 auto;
color: $light-font-color;
}
.speech-arrow-top {
width: 0;
height: 0;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
z-index: 20;
border-top: 10px solid #fff;
position: absolute;
right: 46.7%;
top: 36.5%;
}
.speech-arrow-bottom {
width: 0;
height: 0;
border-left: 12px solid transparent;
border-right: 12px solid transparent;
z-index: 10;
border-top: 11px solid $border-color;
position: absolute;
right: 46.3%;
top: none;
}
.ringer {
margin: 0 auto;
width: 50px;
margin-top: 20px;
}
}
.bell-jar,.mouth,.eye{opacity:0.2;fill:$black;}
.blink, {
animation: blink 5s step-start 0s infinite;
}
#keyframes blink {
53% {
opacity: 0.2;
}
55% {
opacity: 0.0;
}
57% {
opacity: 0.2;
}
59% {
opacity: 0.0;
}
61% {
opacity: 0.2;
}
}
#media (max-width: 767px){
a.dropdown-toggle {
float:right;
}
}
I'm having issues getting this button to stay in the button holder which floats above my site content. How would I add a drop down menu and this keep it in the same button holder.
.btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
.button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family:'Source Sans Pro', sans-serif;
opacity: .8; }
.button:hover {
background-color: #732878; /* Green */
color: white;
}
<div class="btn-holder">
<div class="button"><a href="/"><img class="img-responsive2"
src="http://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png"></a></div>
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
Here's a quick example that should help get you started in the right direction! A few improvements could be made (such as delaying the display:none so that you can actually click links in the menu), but you should be able to figure that out. If not just let me know in the comments and I'll improve it.
#btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
#btn-holder > .button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family: 'Source Sans Pro', sans-serif;
opacity: .8;
border-radius: 3px;
}
#btn-holder > .button:hover {
background-color: #732878;
color: white;
}
#btn-holder > .menu {
opacity: 0;
transition: opacity .5s;
width: 100px;
transform: translate(-50%, -50%);
background-color: #333;
border: none;
color: white;
padding: 8px;
text-align: left;
text-decoration: none;
font-size: 16px;
position: absolute;
right: 0%;
bottom: 25px;
box-shadow:0 2px 7px rgba(0,0,0,.4);
}
.menu a {
text-decoration: none;
color: #eee;
transition: color .3s;
}
.menu a:hover {
color: #2196f3;
}
.menu > ul {
list-style: none;
margin: 2px;
padding: 0 0 0 15px;
}
.menu > ul > li:first-child {
margin-left: -15px;
}
.menu p {
opacity: 1;
margin: 0;
}
.menu p:after {
content:"";
display: block;
height: 1px;
vertical-align: bottom;
width: 100%;
border-top: 1px solid #eee;
opacity: .4;
}
#btn-holder > .button:hover + .menu {
opacity: 1;
transistion-delay: 1s;
}
#btn-holder .menu:hover {
opacity: 1;
}
<div id="btn-holder">
<div class="button">
<img class="img-responsive2" src="https://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png">
</div>
<div class="menu">
<p>Home</p>
<ul>
<li>Blog</li>
<li>Post 1</li>
<li>Post 2</li>
</ul>
<p>Products</p>
<p>About</p>
</div>
</div>
Here's a codepen of it that you can use to try your own changes on: http://codepen.io/XanderLuciano/pen/YGPoqE
I used the CSS + selector to select the div class="menu" that occurs right after the div class="button" and changed it's display from none to block when .button:hover is active. The code looks like this:
#btn-holder > .button:hover + .menu {
display: block;
}
Let me know if you have any questions! :)
#btn-holder {
background: rgba(255, 255, 255, 0.5);
position: static;
z-index: 10;
bottom: 0;
right: 0;
left: 0;
top: 0;
}
#btn-holder > .button {
transform: translate(-50%, -50%);
background-color: #a137a7;
border: none;
color: white;
padding: 8px 13px;
text-align: center;
text-decoration: none;
font-size: 16px;
position: absolute;
cursor: pointer;
right: -1%;
bottom: -1%;
font-family: 'Source Sans Pro', sans-serif;
opacity: .8;
border-radius: 3px;
}
#btn-holder > .button:hover {
background-color: #732878;
color: white;
}
#btn-holder > .menu {
opacity: 0;
transition: opacity .5s;
width: 100px;
transform: translate(-50%, -50%);
background-color: #333;
border: none;
color: white;
padding: 8px;
text-align: left;
text-decoration: none;
font-size: 16px;
position: absolute;
right: 0%;
bottom: 25px;
box-shadow:0 2px 7px rgba(0,0,0,.4);
}
.menu a {
text-decoration: none;
color: #eee;
transition: color .3s;
}
.menu a:hover {
color: #2196f3;
}
.menu > ul {
list-style: none;
margin: 2px;
padding: 0 0 0 15px;
}
.menu > ul > li:first-child {
margin-left: -15px;
}
.menu p {
opacity: 1;
margin: 0;
}
.menu p:after {
content:"";
display: block;
height: 1px;
vertical-align: bottom;
width: 100%;
border-top: 1px solid #eee;
opacity: .4;
}
#btn-holder > .button:hover + .menu {
opacity: 1;
transistion-delay: 1s;
}
#btn-holder .menu:hover {
opacity: 1;
}
<div id="btn-holder">
<div class="button">
<img class="img-responsive2" src="https://static.tumblr.com/e2rgcy1/e6Yod1iwo/pop-out-icon.png">
</div>
<div class="menu">
<p>Home</p>
<ul>
<li>Blog</li>
<li>Post 1</li>
<li>Post 2</li>
</ul>
<p>Products</p>
<p>About</p>
</div>
</div>
Ive been trying to put in this image but the issue i'm getting here is that the image keeps on passing the footer and I cant seem to solve it. Please help me out. The image size for the "batmanshop" is width=890 and height=2000.
Here is the CSS code and below is the HTML code
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-image: url(images/background.png);
margin: 0;
padding: 0;
color: #000;
}
IMG.titleImage {
margin-left: 300px;
}
ul, ol, dl {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0;
padding-right: 15px;
padding-left: 15px;
word-wrap: break-word;
}
a img {
border: none;
}
a:link {
color: black;
}
a:visited {
color: #6E6C64;
}
a:hover, a:active, a:focus {
text-decoration: none;
}
.container {
width: 960px;
height:100%;
background-color: #FFF;
margin: 0 auto;
}
.header {
background-image:url(images/headerbg.png);
height:140px;
}
.content {
width:100%;
height:100%;
background-color: white;
}
.footer {
padding: 10px 0;
background-color: #F1F8E0;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
//Navigation Bar
.nav, .nav ul {
margin: 0;
padding: 0;
list-style: none;
line-height: 1;
}
.nav {
/* Layout & positioning */
position: relative;
margin: auto; /* Centering the menu */
height: 46px;
width: 960px;
text-align: center;
/* Background & effects */
box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
background: #65c0bb;
background-image:url(images/navImage.png);
}
.nav>li {
margin: 0;
line-height: 1;
padding: 0;
display: inline;
position: relative;
margin: 0 12px;
}
.nav::after, .nav::before {
content: "";
display: block;
position: absolute;
top: 6px;
height: 0px;
width: 0px;
border: 23px solid #65c0bb;
z-index: -1;
}
/* The left ribbon */
.nav::before {
border-left-color: transparent;
left: -30px;
}
/* The right ribbon */
.nav::after {
border-right-color: transparent;
right: -30px;
}
.nav>li>a {
display: inline-block;
padding: 15px 20px;
position: relative;
font-family: 'Oswald', sans-serif;
font-size: 16px;
text-transform: uppercase;
text-decoration: none;
color: #fff;
-webkit-transition: color .3s linear;
-moz-transition: color .3s linear;
-o-transition: color .3s linear;
-ms-transition: color .3s linear;
transition: color .3s linear;
}
.nav>li>a:hover, .nav>li:hover>a {
color: #eae8a5;
}
.nav>li>a::after {
content: "";
height: 15px;
width: 15px;
position: absolute;
right: -20px;
top: 16px;
display: block;
}
.nav>li:last-child>a::after {
display: none;
}
.nav ul {
position: absolute;
left: -9999px;
padding-top: 10px;
border-bottom: 1px solid #ccc;
opacity: 0;
-webkit-transition: opacity .3s linear;
-moz-transition: opacity .3s linear;
-o-transition: opacity .3s linear;
-ms-transition: opacity .3s linear;
}
.nav>li:hover>ul {
left: 0;
opacity: 1;
top: 30px;
}
.nav ul li:hover>ul {
left: 150px;
opacity: 1;
top: -11px;
padding-left: 12px;
border-bottom: 0;
box-shadow: none;
}
.nav ul li {
display: block;
position: relative;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
width: 150px;
text-align: justify;
z-index: 9;
background: #eee;
box-shadow: 3px 4px 0 rgba(0, 0, 0, .1);
-webkit-transition: background .3s linear;
-moz-transition: background .3s linear;
-ms-transition: background .3s linear;
-o-transition: background .3s linear;
}
.nav ul li a {
font-family: "Oswald", sans-serif;
font-size: 14px;
text-decoration: none;
display: block;
padding: 7px 12px 7px 20px;
color: #65c0bb;
-webkit-transition: color .3s linear;
-moz-transition: color .3s linear;
-ms-transition: color .3s linear;
-o-transition: color .3s linear;
}
.nav ul li:hover>a, .nav ul li a:hover {
color: #4db6b0;
}
.nav ul li:hover {
background: #f7f7f7;
}
.nav ul ul li:last-child {
border-bottom: 1px solid #ccc;
}
.nav ul ul li {
box-shadow: 3px 3px 0 rgba(0, 0, 0, .1);
}
.nav ul::after, .nav ul::before {
content: "";
display: block;
z-index: 1;
position: absolute;
height: 9px;
width: 9px;
}
.nav>li>ul::after {
border: 1px solid #ccc;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 5px;
left: 25px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
.nav>li>ul::before {
height: 1px;
width: 12px;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 10px;
left: 24px;
z-index: 99;
}
.nav ul ul::after {
border: 1px solid #ccc;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 20px;
left: 8px;
position: absolute;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
}
.nav ul ul::before {
height: 10px;
width: 1px;
background: #eee;
z-index: 99;
top: 20px;
left: 12px;
}
.titleImage2 {
margin-left: 250px;
}
.birthdayDream {
padding-right: 15px;
padding-left: 15px;
float: right;
}
p1 {
display: block;
margin-top: 30px;
padding-right: 15px;
padding-left: 15px;
}
form {
margin-left: auto;
margin-right: auto;s
display:inline-block;
width:600px;
}
input {
float:right;
margin-right: 50px;
clear:both;
}
input2 {
float:left;
}
.row {
margin-left: 200px;
}
.batmanImage {
margin-left: 180px;
}
.batmanshop {
height:auto;
margin: 0 auto;
}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css">
<title>Birthday Planner - Home</title>
</head>
<body>
<div class="container">
<div class="header">
</div>
<ul class="nav">
<li>
Home
</li>
<li>
Themes
<ul>
<li>Boys Party Theme</li>
<li>Girls Party Theme</li>
</ul>
</li>
<li>About</li>
<li>Contact</li>
<li>Login</li>
<li>Sign Up</li>
</ul>
<div class="content">
<br/>
<IMG class="batmanImage">
<img src="images/batmantitle.jpg" name="Title" width="600" height="206">
</IMG>
<p>All you need to do is select the desired theme and provide us the necessary details. We will do the rest. The items listed below are what will be provided when you order this theme. Don't need to worry about anything else. Just a click of a button and we will get our team to handle the rest for you.
</p>
<IMG class="batmanshop">
<img src="images/batmanshop.jpg" name="Title">
</IMG>
</div>
<div class="footer">
<div class="navigationbar">
<ul class="nav">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
<li>
Terms and Conditions
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
Whatever you want to achieve, you can not do that :
<IMG class="batmanshop">
<img src="images/batmanshop.jpg" name="Title">
</IMG>
I replaced that by: <img class="batmanshop" src="images/batmanshop.jpg" name="Title" />
Anyway, even with your code, I do not see the image passing over the footer.
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-image: url(images/background.png);
margin: 0;
padding: 0;
color: #000;
}
IMG.titleImage {
margin-left: 300px;
}
ul, ol, dl {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0;
padding-right: 15px;
padding-left: 15px;
word-wrap: break-word;
}
a img {
border: none;
}
a:link {
color: black;
}
a:visited {
color: #6E6C64;
}
a:hover, a:active, a:focus {
text-decoration: none;
}
.container {
width: 960px;
height:100%;
background-color: #FFF;
margin: 0 auto;
}
.header {
background-image:url(images/headerbg.png);
height:140px;
}
.content {
width:100%;
height:100%;
background-color: white;
}
.footer {
padding: 10px 0;
background-color: #F1F8E0;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
//Navigation Bar
.nav, .nav ul {
margin: 0;
padding: 0;
list-style: none;
line-height: 1;
}
.nav {
/* Layout & positioning */
position: relative;
margin: auto; /* Centering the menu */
height: 46px;
width: 960px;
text-align: center;
/* Background & effects */
box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
background: #65c0bb;
background-image:url(images/navImage.png);
}
.nav>li {
margin: 0;
line-height: 1;
padding: 0;
display: inline;
position: relative;
margin: 0 12px;
}
.nav::after, .nav::before {
content: "";
display: block;
position: absolute;
top: 6px;
height: 0px;
width: 0px;
border: 23px solid #65c0bb;
z-index: -1;
}
/* The left ribbon */
.nav::before {
border-left-color: transparent;
left: -30px;
}
/* The right ribbon */
.nav::after {
border-right-color: transparent;
right: -30px;
}
.nav>li>a {
display: inline-block;
padding: 15px 20px;
position: relative;
font-family: 'Oswald', sans-serif;
font-size: 16px;
text-transform: uppercase;
text-decoration: none;
color: #fff;
-webkit-transition: color .3s linear;
-moz-transition: color .3s linear;
-o-transition: color .3s linear;
-ms-transition: color .3s linear;
transition: color .3s linear;
}
.nav>li>a:hover, .nav>li:hover>a {
color: #eae8a5;
}
.nav>li>a::after {
content: "";
height: 15px;
width: 15px;
position: absolute;
right: -20px;
top: 16px;
display: block;
}
.nav>li:last-child>a::after {
display: none;
}
.nav ul {
position: absolute;
left: -9999px;
padding-top: 10px;
border-bottom: 1px solid #ccc;
opacity: 0;
-webkit-transition: opacity .3s linear;
-moz-transition: opacity .3s linear;
-o-transition: opacity .3s linear;
-ms-transition: opacity .3s linear;
}
.nav>li:hover>ul {
left: 0;
opacity: 1;
top: 30px;
}
.nav ul li:hover>ul {
left: 150px;
opacity: 1;
top: -11px;
padding-left: 12px;
border-bottom: 0;
box-shadow: none;
}
.nav ul li {
display: block;
position: relative;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
width: 150px;
text-align: justify;
z-index: 9;
background: #eee;
box-shadow: 3px 4px 0 rgba(0, 0, 0, .1);
-webkit-transition: background .3s linear;
-moz-transition: background .3s linear;
-ms-transition: background .3s linear;
-o-transition: background .3s linear;
}
.nav ul li a {
font-family: "Oswald", sans-serif;
font-size: 14px;
text-decoration: none;
display: block;
padding: 7px 12px 7px 20px;
color: #65c0bb;
-webkit-transition: color .3s linear;
-moz-transition: color .3s linear;
-ms-transition: color .3s linear;
-o-transition: color .3s linear;
}
.nav ul li:hover>a, .nav ul li a:hover {
color: #4db6b0;
}
.nav ul li:hover {
background: #f7f7f7;
}
.nav ul ul li:last-child {
border-bottom: 1px solid #ccc;
}
.nav ul ul li {
box-shadow: 3px 3px 0 rgba(0, 0, 0, .1);
}
.nav ul::after, .nav ul::before {
content: "";
display: block;
z-index: 1;
position: absolute;
height: 9px;
width: 9px;
}
.nav>li>ul::after {
border: 1px solid #ccc;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 5px;
left: 25px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
-ms-transform: rotate(45deg);
}
.nav>li>ul::before {
height: 1px;
width: 12px;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 10px;
left: 24px;
z-index: 99;
}
.nav ul ul::after {
border: 1px solid #ccc;
background: #eee;
border-right: 0;
border-bottom: 0;
top: 20px;
left: 8px;
position: absolute;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
}
.nav ul ul::before {
height: 10px;
width: 1px;
background: #eee;
z-index: 99;
top: 20px;
left: 12px;
}
.titleImage2 {
margin-left: 250px;
}
.birthdayDream {
padding-right: 15px;
padding-left: 15px;
float: right;
}
p1 {
display: block;
margin-top: 30px;
padding-right: 15px;
padding-left: 15px;
}
form {
margin-left: auto;
margin-right: auto;s
display:inline-block;
width:600px;
}
input {
float:right;
margin-right: 50px;
clear:both;
}
input2 {
float:left;
}
.row {
margin-left: 200px;
}
.batmanImage {
margin-left: 180px;
}
.batmanshop {
height:auto;
margin: 0 auto;
}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css">
<title>Birthday Planner - Home</title>
</head>
<body>
<div class="container">
<div class="header">
</div>
<ul class="nav">
<li>
Home
</li>
<li>
Themes
<ul>
<li>Boys Party Theme</li>
<li>Girls Party Theme</li>
</ul>
</li>
<li>About</li>
<li>Contact</li>
<li>Login</li>
<li>Sign Up</li>
</ul>
<div class="content">
<br/>
<IMG class="batmanImage">
<img src="images/batmantitle.jpg" name="Title" width="600" height="206">
</IMG>
<p>All you need to do is select the desired theme and provide us the necessary details. We will do the rest. The items listed below are what will be provided when you order this theme. Don't need to worry about anything else. Just a click of a button and we will get our team to handle the rest for you.
</p>
<img class="batmanshop" src="http://placehold.it/890x2000&text=Batmanshop" name="Title" />
</div>
<div class="footer">
<div class="navigationbar">
<ul class="nav">
<li>
Home
</li>
<li>
About
</li>
<li>
Contact
</li>
<li>
Terms and Conditions
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
I am working on a project where I am making two divs that are full width the main one comes first and the second div comes after the main div.
Main Div CSS:
*{
margin:0px;
padding:0px;
}
div.main{
top: -100px;
/*background: url(img/bg.jpg) no-repeat center center fixed #000000;*/
/*background: url(http://www.deliciousfood4u.com/wp-content/uploads/2012/05/food_steak_desktop_1302x1020_wallpaper-420339.jpg) no-repeat center center fixed #324a6f;*/
background-size: cover;
background-repeat: no-repeat;
margin-left: -1px;
position: absolute;
}
html, body, .main, #wrappertwo { height: 100%; min-height: 100%; }
.main { margin: 0 auto; oveflow: hidden; width: 100%; background-color: gray;}
I would like my end website to work similar to this website here: http://www.whitmansnyc.com/
You can see all the code here: http://jsfiddle.net/QFRB8/
Here you go, I'm sure you will have much better use than me. Just edit the box in there and delete it to have a full width with main and second div.
http://jsfiddle.net/tS9fX/
html:
<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Blah</title>
<link type="text/css" rel="stylesheet" media="all" href=
"style.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css_002.css" />
</head>
<body class="user_suscriptions index">
<div id="wrapper">
<h1 class="logo">Title</h1>
<h2>another title</h2>
<div class="field form_suscription">
<form novalidate="novalidate" method="post" id="new_user_suscription" data-remote=
"true" class="simple_form new_user_suscription" action="/user_suscriptions"
accept-charset="UTF-8" name="new_user_suscription">
<div style="margin:0;padding:0;display:inline">
<input type="hidden" value="✓" name="utf8" /> <input type="hidden"
value="1Oz4NpXl188INQoGZkqy4LaItW/6sxtsNNruWFBJQEM=" name=
"authenticity_token" />
</div>
<div class="error_message"></div>
<div class="input email required user_suscription_email">
<input type="email" size="50" placeholder="Your email address ;)" name=
"user_suscription[email]" id="user_suscription_email" class=
"string email required left" autofocus="autofocus" />
</div><input type="submit" value="Subscribe!" name="commit" class=
"btn green-btn" />
</form>
<div class="clear"></div><small>blahb</small>
</div>
<div class="clear"></div>
<div class="content">
<div class="left">
<h2 class="logo">test subject</h2>
</div>
<div class="right">
<h2>Blah title.</h2>
<p>Blah</p>
</div>
<div class="clear"></div>
</div>
<div class="content">
<div class="block">
<h3>blag</h3>
<p>blag</p>
</div>
<div class="block">
<h3>blag</h3>
<p>blag</p>
</div>
<div class="block">
<h3>blag</h3>
<p>blag</p>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</body>
</html>
CSS:
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden] {
display: none;
}
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:active,
a:hover {
outline: 0;
}
h1 {
font-size: 2em;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
mark {
background: #ff0;
color: #000;
}
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
button,
input {
line-height: normal;
}
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
button[disabled],
input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
font: 14px "Lato", sans-serif;
background: url(http://i.imgur.com/oRLPdXl.jpg) no-repeat center center fixed;
background-size: cover;
color: #FFF; }
#bgMax {
min-height: 100%;
min-width: 1400px;
width: 100%;
height: auto;
position: fixed;
top: 0;
left: 0; }
a {
text-decoration: none;
color: white; }
p {
font-size: 16px;
line-height: 30px; }
li {
list-style: none; }
.clear {
clear: both;
visibility: hidden; }
.bgFade {
background-color: white; }
input[type="text"], input[type="email"] {
border: none;
padding: 14px;
font-size: 16px;
border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-moz-border-radius: 3px; }
input[type="text"]:focus, input[type="email"]:focus {
border-color: red;
outline: none; }
.green-btn {
background: url("http://printgram.noflagra.com/wp-content/themes/Printgram/css/images/comofunciona-bg.png") repeat scroll 0 0 transparent;
color: white;
padding: 16px;
font-weight: bold;
display: inline-block;
width: initial;
border: none;
border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-moz-border-radius: 3px;
transition: 0.2s all ease-out;
-webkit-transition: 0.2s all ease-out;
-moz-transition: 0.2s all ease-out;
-o-transition: 0.2s all ease-out; }
.green-btn:hover {
background: #34da97; }
.green-btn:active {
background: #08b16d; }
::-webkit-scrollbar {
width: 15px;
margin-left: 10px;
background: white;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb {
border: solid 0 transparent;
border-right-width: 3px;
border-left-width: 4px;
-webkit-border-radius: 9px 6px;
-webkit-box-shadow: inset 0 0 0 1px #a1a1a1, inset 0 0 0 6px #a1a1a1; }
::-webkit-scrollbar-thumb:hover {
-webkit-box-shadow: inset 0 0 0 1px gray, inset 0 0 0 6px gray; }
::-webkit-scrollbar-track-piece {
background: transparent none;
border: solid 4px transparent;
border-right-width: 8px;
margin: 4px; }
#-webkit-keyframes fadeInUp {
0% {
opacity: 0;
-webkit-transform: translateY(30px); }
100% {
opacity: 1;
-webkit-transform: translateY(0); } }
#-moz-keyframes fadeInUp {
0% {
opacity: 0;
-moz-transform: translateY(30px); }
100% {
opacity: 1;
-moz-transform: translateY(0); } }
#-o-keyframes fadeInUp {
0% {
opacity: 0;
-o-transform: translateY(30px); }
100% {
opacity: 1;
-o-transform: translateY(0); } }
#keyframes fadeInUp {
0% {
opacity: 0;
transform: translateY(30px); }
100% {
opacity: 1;
transform: translateY(0); } }
#-webkit-keyframes fadeIn {
0% {
opacity: 0; }
100% {
opacity: 1; } }
#-moz-keyframes fadeIn {
0% {
opacity: 0; }
100% {
opacity: 1; } }
#-o-keyframes fadeIn {
0% {
opacity: 0; }
100% {
opacity: 1; } }
#keyframes fadeIn {
0% {
opacity: 0; }
100% {
opacity: 1; } }
.logo {
font-family: "Pacifico", cursive;
color: white;
font-weight: normal;
margin: 0; }
.content {
width: 1000px;
margin: 0 auto;
padding: 100px 0px; }
.left {
float: left; }
.right {
float: right; }
header .content {
padding: 0; }
header .language {
float: right;
margin-top: 15px; }
header .language .social {
float: left;
margin-right: 10px; }
header .language .social .fb, header .language .social .tw {
float: left;
margin: 0 5px; }
header .language .select {
float: left;
background: white;
border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-moz-border-radius: 3px;
padding: 1px 9px; }
header .language .select a {
font-weight: bold;
font-size: 12px;
color: #999999; }
.info {
animation: fadeInUp 1s 1;
-moz-animation: fadeInUp 1s 1;
-webkit-animation: fadeInUp 1s 1;
-o-animation: fadeInUp 1s 1;
width: 910px;
margin: 0 auto;
padding: 120px 0px 190px 0px;
text-align: center; }
.info small {
color: white;
display: block;
font-size: 15px;
margin: 5px;
text-shadow: 0px 1px 1px #353535;
-webkit-text-shadow: 0px 1px 1px #353535;
-o-text-shadow: 0px 1px 1px #353535;
-moz-text-shadow: 0px 1px 1px #353535; }
.info .logo {
font-size: 70px; }
.info h2 {
color: white;
font-size: 30px;
font-weight: 300;
text-align: center;
margin: 40px 0px;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
-webkit-text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
-o-text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
-moz-text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); }
.info .field {
margin: 50px 0px 10px 0px;
animation: fadeInUp 1s 1;
-moz-animation: fadeInUp 1s 1;
-webkit-animation: fadeInUp 1s 1;
-o-animation: fadeInUp 1s 1;
width: 570px;
margin: 0 auto; }
.info .field input {
width: 400px;
margin: 10px 0px; }
.info .field .btn {
margin: 10px 0px; }
.info .field .green-btn {
width: initial; }
.info .social {
margin: 0px 0px 60px 0px; }
.about {
background: url("http://printgram.noflagra.com/wp-content/themes/Printgram/css/images/comofunciona-bg.png") repeat scroll 0 0 transparent; }
.about .logo {
color: white;
font-size: 50px; }
.about p {
font-weight: bold; }
.about h2 {
font-size: 22px; }
.about .left {
float: left;
width: 50%;
margin-top: 50px;
text-align: center; }
.about .right {
width: 50%;
float: right;
color: white;
font-weight: 300; }
.demo .content {
padding: 130px 0px 150px 0px;
text-align: center; }
.demo h2 {
font-size: 30px; }
.demo .social {
margin-top: 20px;
display: inline-block; }
.demo .social .fb, .demo .social .gp, .demo .social .tw {
float: left;
margin: 0 5px; }
.features {
background: url("http://printgram.noflagra.com/wp-content/themes/Printgram/css/images/porque-bg.png") repeat scroll 0 0 transparent;
overflow: hidden; }
.features .content {
padding: 100px 0px;
margin: 0 auto; }
.features .block {
float: left;
width: 30%;
margin: 15px;
text-align: center;
position: relative; }
.features .block h3 {
font-size: 22px; }
.features .block p {
padding: 0px 20px; }
.features .feature1, .features .feature2, .features .feature3, .features .feature4, .features .feature5, .features .feature6 {
width: 152px;
height: 153px;
margin: auto; }
.features .feature1 {
background: url("http://printgram.noflagra.com/wp-content/uploads/2012/08/2-tralha1.png") no-repeat scroll center center transparent;
}
.features .feature2 {
background: url("http://printgram.noflagra.com/wp-content/uploads/2012/08/1-instagram1.png") no-repeat scroll center center transparent;
}
.features .feature3 {
background: url("http://printgram.noflagra.com/wp-content/uploads/2012/08/3-foto1.png") no-repeat scroll center center transparent;
}
footer {
background: url("http://printgram.noflagra.com/wp-content/themes/Printgram/css/images/footer-bg.png") repeat scroll 0 0 transparent;
border-top: 10px solid #464646;
color: white;
height: 100%;
}
footer .content {
width: 600px;
padding: 40px 0px;
text-align: center; }
footer .content .logo {
font-size: 25px;
font-weight: 300; }
footer .content p, footer .content a {
font-weight: 700; }
footer .content ul {
text-align: center;
padding: 0px;
display: block;
margin-bottom: 50px; }
footer .content ul li {
display: inline-block; }
footer .content ul a {
border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-moz-border-radius: 3px;
background: #0cad6c;
padding: 3px 7px;
margin: 3px; }
#media only screen and (max-width: 480px) {
header .content {
padding: 0;
margin-top: 0;
margin-bottom: 0; }
#bgMax {
left: 50%;
margin-left: -200px; }
#wrapper {
width: inherit; }
.content, .info {
margin: 20% auto;
width: 85%;
overflow: hidden; }
.info {
margin: 12% auto;
padding-top: 50px;
padding-bottom: 50px; }
.info .logo {
font-size: 55px; }
.info h2 {
font-size: 20px; }
.info small {
font-size: 11px; }
.info .field {
width: 100%; }
.info .field input, .info .field .green-btn {
padding: 12px;
font-size: 12px;
margin-top: 0px;
margin-bottom: 5px; }
.info .field input {
width: 90%%; }
.about {
font-size: 12px;
text-align: center; }
.about .left, .about .right {
width: auto; }
.about .left {
float: inherit;
margin: 0; }
.about .left h2 {
font-size: 40px; }
.about .right h2 {
font-size: 18px; }
.about .right p {
font-size: 14px;
line-height: 28px; }
.demo .content {
padding: 50px 0px; }
.demo .social {
width: 100px; }
.features {
font-size: 12px; }
.features .content {
width: 80%;
padding: 50px 0px; }
.features .block {
width: auto;
float: inherit;
margin: 55px 0px; }
.features .block h3 {
font-size: 18px; }
.features .block p {
line-height: 28px;
font-size: 14px; }
footer .content {
margin: 20% auto;
width: 85%;
overflow: hidden;
margin: 5% auto; } }
#media only screen and (min-width: 481px) and (max-width: 1024px) {
header .content {
padding: 0;
margin-top: 0;
margin-bottom: 0; }
#wrapper {
width: inherit; }
.content, .info {
margin: 15% auto;
width: 70%;
overflow: hidden; }
.info {
margin: 8% auto;
padding-top: 50px;
padding-bottom: 50px; }
.info .field {
width: 420px; }
.info .field input {
width: 50%; }
.about {
text-align: center; }
.about .left, .about .right {
width: auto; }
.about .left {
float: inherit;
margin: 0; }
.demo .content {
padding: 50px 0px; }
.features .content {
width: 80%;
padding: 50px 0px; }
.features .block {
width: auto;
float: inherit;
margin: 55px 0px; }
footer .content {
margin: 15% auto;
width: 70%;
overflow: hidden;
margin: 5% auto; } }
.error {
color: white;
text-shadow: 0px 1px 1px #353535;
-webkit-text-shadow: 0px 1px 1px #353535;
-o-text-shadow: 0px 1px 1px #353535;
-moz-text-shadow: 0px 1px 1px #353535;
animation: fadeInUp 1s 1;
-moz-animation: fadeInUp 1s 1;
-webkit-animation: fadeInUp 1s 1;
-o-animation: fadeInUp 1s 1;
font-weight: bold; }
.exist, .succesfull {
color: #5f5f5f;
font-size: 16px;
font-weight: normal;
width: 270px;
padding: 12px 10px;
margin: 0 auto;
border-radius: 5px;
background: white;
animation: fadeInUp 1s 1;
-moz-animation: fadeInUp 1s 1;
-webkit-animation: fadeInUp 1s 1;
-o-animation: fadeInUp 1s 1; }
.temp {
display: none;
color: #cccccc; }