make a section visible by hovering over paragraphs - html

I know this question already has some answers, but I can't figure out how to make a section visible when it has the display:none property. I need to make it visible when I mouse over some paragraphs. Here's my code:
.buttons {
width: 97px;
margin: 0;
padding: 0;
font-size: 14px;
color: #fff;
text-align: center;
background-image: url("/res/downArrow.png");
background-repeat: no-repeat;
background-position: right;
}
.buttons:hover > .label {
background-color: #fff;
color: #000;
background-image: url("/res/upArrow.png");
cursor: pointer;
visibility: visible;
}
.label {
position: absolute;
width: 100%;
height: 150px;
top: 35px;
background-color: #fff;
border-bottom: solid 3px #3f84f2;
display: none;
}
<section class="header">
<div class="menu left">
<div class="logo left"></div>
<p class="buttons left">REVIEWS</p>
<p class="buttons left">FEATURES</p>
<p class="buttons left">GUIDES</p>
<p class="buttons left">VIDEOS</p>
<p class="buttons left">GALLERIES</p>
<p class="buttons left">FORUMS</p>
<p class="buttons left">EVENTS</p>
<div class="left">
<input type="text" value="Search Products & Articles" />
</div>
<div class="login-icon right"></div>
</div>
</section>
<section class="label"></section>
For example! check out this site please http://www.engadget.com/ and see the behavior of the menu. Thanks

This can not be done with CSS unless you move .label into the same container as your .buttons. CSS has no parent selector to traverse the DOM like javascript does so the element has to be either a sibling or a descendant:
<section class="header">
<div class="menu left">
<div class="logo left"></div>
<p class="buttons left">REVIEWS</p>
<p class="buttons left">FEATURES</p>
<p class="buttons left">GUIDES</p>
<p class="buttons left">VIDEOS</p>
<p class="buttons left">GALLERIES</p>
<p class="buttons left">FORUMS</p>
<p class="buttons left">EVENTS</p>
<div class="left">
<input type="text" value="Search Products & Articles" />
</div>
<div class="login-icon right"></div>
<section class="label">SHOW THE TEXT</section>
</div>
</section>
And also you're using display: none on label but calling visibility:visible on hover. It needs to be another display property other than hidden:
.buttons:hover ~ .label{ //target sibling
background-color: #fff;
color: #000;
background-image: url("/res/upArrow.png");
cursor: pointer;
display:block; //add
}
FIDDLE
If you want to do this with your current HTML structure you can use a .hover() function in jQuery pretty simply:
$(".buttons").hover(function(){
$(".label").toggle();
});
JS EXAMPLE

You should use display:block; instead of visibility as you're hiding by using display:none:
.buttons:hover ~ .label{/*used ~ instead of > to refer nextAll siblings*/
background-color: #fff;
color: #000;
background-image: url("/res/upArrow.png");
cursor: pointer;
display: block;
}
If you have used visibility:hidden in label then only needed to use visibility:visible in .buttons:hover > .label
And you should use html like this:
<section class="header">
<div class="menu left">
<div class="logo left"></div>
<p class="buttons left">REVIEWS</p>
<p class="buttons left">FEATURES</p>
<p class="buttons left">GUIDES</p>
<p class="buttons left">VIDEOS</p>
<p class="buttons left">GALLERIES</p>
<p class="buttons left">FORUMS</p>
<p class="buttons left">EVENTS</p>
<div class="left">
<input type="text" value="Search Products & Articles" />
</div>
<div class="login-icon right"></div>
</div>
<div class="label"></div>
</section>

Related

How to position a large number of elements using flexbox without resorting to position: absolute?

I'm doing a landing page for testing flexbox technology. I ran into a problem: I can't figure out how to position a large number of elements without resorting to crutches like this:
Also without resorting to position:absolute, because there will be inaccuracies in the margins or it will take a very long time to calculate these margins.
This is what I currently have:
On the second one, I indicated how I see one of the working implementation options: organize two columns in footer and make them flex-direction: column.
Here is my markup:
<footer class="footer">
<div class="footer__logo">
<img src="icons/Logo.svg" alt="logo" class="logo__img">
<p class="logo__text"> PETWORLD </p>
</div>
<div class="footer__input">
<label for="email" class="text">Updates right to your Inbox</label>
<input type="email" placeholder="Email Address" class="text">
<input type="submit" value="Send" class="submit__text text">
</div>
<div class="footer__privacy">
<p class="privacy__text"> Text</p>
<p class="privacy__text"> Text</p>
<p class="privacy__text"> Text</p>
</div>
<div class="footer__menu">
<!-- x3 колонки текста -->
<div class="menu__text">
<p class="text">Text</p>
<p class="text">Text</p>
<p class="text">Text</p>
</div>
</div>
<div class="footer__social">
<img src="icons/Socials icons.svg" alt="" class="logo__img">
</div>
</footer>
I decided to move away from BEM a bit and divided my footer into two visual components.
What came out in the end can be viewed below:
https://codepen.io/productomar/pen/ZEvNQjG
------------------HTML---------------------
<div class="container__footer">
<footer class="footer">
<div class="first__half">
<div class="footer__logo">
<img src="icons/Logo.svg" alt="logo" class="logo__img">
<p class="logo__text"> PETWORLD </p>
</div>
<div class="footer__input">
<label for="email" class="text">Updates right to your Inbox</label>
<input type="email" placeholder="Email Address" class="placeholder__text">
<input type="submit" value="Send" class="submit__text text">
</div>
<div class="footer__privacy">
<p class="privacy__text"> © PETWORLD 2022</p>
<p class="privacy__text"> Privacy policy</p>
<p class="privacy__text"> Terms of use</p>
</div>
</div>
<div class="second__half">
<div class="footer__menu">
<div class="menu__text">
<p class="text menu__b" style="font-weight: 600;">Our story</p>
<p class="text__item text">FAQ</p>
<p class="text__item text">Contact</p>
</div>
<div class="menu__text">
<p class="text menu__b" style="font-weight: 600;">Pet care</p>
<p class="text__item text">Treatments</p>
<p class="text__item text">Health</p>
<p class="text__item text">Hygiene </p>
</div>
<div class="menu__text">
<p class="text menu__b" style="font-weight: 600;">Shop</p>
<p class="text__item text">Pet Food</p>
<p class="text__item text">Toys</p>
<p class="text__item text">Accessories</p>
</div>
</div>
<div class="footer__social">
<img src="icons/Socials icons.svg" alt="logo__social" class="logo__social">
</div>
</div>
</footer>
</div>
------------------CSS---------------------
/* Первая часть футера */
.first__half {
display: flex;
flex-direction: column;
}
.footer {
display: flex;
padding: 70px 80.5px;
}
.footer__logo {
display: flex;
align-items: center;
}
.logo__text {
font-weight: bold;
}
.footer__input {
margin-top: 75px;
}
label {
display: block;
}
input[type="email"] {
border: 1px solid #D0D0D0;
border-radius: 10px;
margin-top: 12px;
}
.placeholder__text {
padding-top: 11px;
padding-bottom: 11px;
padding-left: 20px;
padding-right: 71px;
font-size: 18px;
color: #2D2D2D;
}
.submit__text {
padding: 11px 31.5px;
background-color: #3366FF;
color: white;
border-radius: 10px;
margin-left: 20px;
}
.footer__privacy {
display: flex;
margin-top: 33px;
}
.privacy__text {
margin-right: 30px;
font-weight: 600;
}
.privacy__text:nth-child(3) {
margin-right: 0px;
}
/* Вторая часть футера */
.second__half {
margin-left: 233px;
}
.footer__menu {
display: flex;
}
.menu__text {
margin-right: 60px;
}
.text__item {
padding-top: 16px;
}
.menu__text:nth-child(3) {
margin-right: 0px;
}
.footer__social {
margin-top: 99px;
}
.logo__social {
margin-left: 237px;
}

Div's content not being contained and is overlapping (Bootstrap, Css, MVC)

I Currently am designing a login page in mvc and I want to seperate certain elements so they can be styled correctly. However when I create div's inside other divs they do not stick to the outer div's height and therefore move all around the page. I will give you a sample with my code.
In my Layout.cshtml page I've got
<div class="login-box-outer">
<div class="container">
<div class="login-box">
<div class="login-logo">
<a href="example" </b> Example</a>
</div>
#RenderBody()
</div>
</div>
</div>
In my register page I have the following
.form-control{
height: 35px;
}
.login-logo{
display: none;
}
.login-box, .register-box {
width: 500px;
margin: 2% auto;
}
.text-danger {
color: #a94442;
}
.login-page, .register-page {
background: url('https://example.jpg');
background-position: center;
background-size: cover;
}
##media(max-width: 400px)
{
.login-box, .register-box {
width: 300px;
margin: 4% auto;
}
}
.intl-tel-input{
display: block !important;
}
.join-section__shadow {
left:10%;
bottom:35%;
position: absolute;
padding: 96px 0 48px;
}
.join-content-layout {
background-color: transparent;
padding: 0;
max-width: 1110px;
margin: 0 auto;
position: relative;
color:white;
}
.join-xlarge {
font-size: 38px;
line-height: 44px;
font-weight: 800;
text-shadow: 0 0 3px rgba(0,0,0,.3);
}
.join-medium {
font-size: 24px;
margin-top: 10px;
font-weight: 500;
text-shadow: 0 0 1px rgba(0,0,0,.5);
}
.content-frame.purple2-bg {
background: #fff;
}
.container-fluid.support-block {
padding-top: 30px;
padding-bottom: 30px;
}
.support-block a {
text-decoration: none;
}
</style>
still in the register page here is my html
<div class="container-fluid support-block">
<div class="join-section__shadow">
<div class="join-content-layout">
<div class="col-md-12 col-sm-12">
<h1 class="join-xlarge join-headline join-h1">
Example
</h1>
<h3 class="join-medium join-h3">
Example
</h3>
</div>
</div>
</div>
<div class="col-xs-10 col-xs-push-10 noPadding" style="bottom:100px;">
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="#ViewBag.ReturnUrl" method="post" role="form">
#Html.AntiForgeryToken()
<div class="box box-primary col-xs-12 boxShadow" style="border:none;margin-bottom:10px;">
<div class="form-group has-feedback col-xs-12 noPadding">
<label>Name</label>
<input asp-for="#Model.FullName" value="#Model.FullName" class="form-control" />
<span asp-validation-for="#Model.FullName" class="text-danger"></span>
</div>
</form>
</div>
</div>
<div class="container-fluid">
<div class="content-frame purple2-bg">
<div class="container-fluid support-block">
<div class="row icon-row">
<div class="col-md-4">
<i class="fa fa-tag" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
<div class="col-md-4">
<i class="fa fa-thumbs-up" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
<div class="col-md-4">
<i class="fa fa-money" style="font-size:155px;" aria-hidden="true"></i>
<div class="text-holder">
<strong class="name">Example</strong><br />
Example
</div>
</div>
</div>
</div>
</div>
</div>
However, under the form I want a complete new section but the content from the form and everything else seems to just float about on the page! Anybody know why this is happening?
Here is how it looks in the browser
This container should be taking up the full width of the screen but it's just floating around. Any idea as to why this is happening?

Vertically aligning div using CSS and Bootstrap?

I am trying to build a simple survey with 10 questions which are stored in my database, looped through and the 10 questions are added to the page dynamically. Basically, I would like there to only be one question on the page at a time, but the page to be scrollable to see the other questions.
For example, question 1 would show up in the middle of the page, the user types their answer and clicks next, and the page scrolls to the next question. If the user scrolls up, it scrolls through the page up, and down scrolls down. For jumping to the next question I was planning on just having each question with an id and the next button just having a link to that id.
My HTML for populating the questions on the page looks like this:
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
My CSS for the above looks like this:
.question {
color: #232A33;
text-align: left;
font-size: 2em;
}
.description {
color: #FFCD3D;
text-align: left;
font-size: 1.25em;
}
.answer {
color: #232A33;
text-align: left;
font-size: 1.25em;
}
I managed to get the question centered on the page using the following code:
.wrapper {
width: 500px;
height: 150px;
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
This works fine for one question, but if there are multiple questions they all overlap each other because the position is absolute.
Any tips on how I can achieve this design for the page?
Thanks in advance!
You're very close. This can be done by adding just a tad more css in (adjusting the row class slightly).
If you add the following:
.row {
width: 100%;
margin: 15% auto;
height: 100vh!important;
}
and adjust your wrapper to **relative** positioning, you should see a good result
.wrapper {
width: 500px;
height: auto;
position: relative;
}
See snippet or fiddle
.question {
color: #232A33;
text-align: left;
font-size: 2em;
}
.description {
color: #FFCD3D;
text-align: left;
font-size: 1.25em;
}
.answer {
color: #232A33;
text-align: left;
font-size: 1.25em;
}
.row {
width: 100%;
margin: 15% auto;
height: 100vh!important;
}
.wrapper {
width: 500px;
height: auto;
position: relative;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>
<div class="container">
<div class="row wrapper">
<div class="question">
<p>What is your name?</p>
</div>
<div class="description">
<p>Used for...</p>
</div>
<div class="answer">
<input type="text" placeholder="">
</div>
</div>
</div>

Bootstrap 3 columns are not staying put/disappearing

I am working on a simple html page, making good use of bootstrap columns, and I am running into the weirdest issue. The columns are disappearing on me. Or at least when I look at firebug not going where they should be. I was hoping someone would know what ever stupid mistake I am making, or perhaps quirk I stumpled upon.
Here is my embeded CSS:
<!DOCTYPE html>
<html lang="en">
<head>
<title> test </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
/* define the headers for each section */
h1 {
margin: auto;
padding-top: 10%;
padding-bottom: 5%;
text-decoration: underline;
} h1:before {
content: "\00a0\00a0";
} h1:after {
content: "\00a0\00a0";
} span {
color: #111;
text-decoration: none;
z-index: 1;
}
/* Define the Nav Bar */
.navbar {
padding-top: 5px;
padding-bottom: 5px;
background-color: #9fc;
width: 100%;
border: solid;
border-bottom-width: 2px;
border-color: white;
} li:hover {
background-color: #7da;
}.dropbtn { /* Dropdown Button */
padding: 16px;
border: none;
cursor: pointer;
} .dropdown { /* The container <div> - needed to position the dropdown content */
position: relative;
display: inline-block;
} .dropdown-content { /* Dropdown Content (Hidden by Default) */
display: none;
position: absolute;
background-color: #9fc;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border: solid;
border-top-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
border-color: white;
z-index: 1;
} .dropdown-content a { /* Links inside the dropdown */
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
border: solid;
border-bottom-width: 1px;
border-color: white;
} .dropdown-content a:hover { /* Change color of dropdown links on hover */
background-color: #f1f1f1
} .dropdown:hover .dropdown-content { /* Show the dropdown menu on hover */
display: block;
}
/* Home section of the page */
.bg-head {
min-height: 100vh;
background-image: url(bgtest.jpg);
overflow: auto;
} .bg-head img {
padding-top: 15vh;
padding-bottom: 10px;
} .bg-head p {
background-color: white;
opacity: 0.8;
padding: 10px;
} .bg-head .center {
margin: auto;
}
/* Define the Section type 1 */
.bg-1 {
min-height: 100vh;
background-color: #39f;
color: #222;
overflow: auto;
} .bg-1 h1 { /* Underline color */
color: #fff;
} .bg-1 span { /* header text color */
color: #222;
} .bg-1 img {
padding: 5px;
}
/* Define the Section type 2 */
.bg-2 {
min-height: 100vh;
background-color: #222;
color: #eee;
overflow: auto;
} .bg-2 h1 { /* Underline color */
color: #39f;
} .bg-2 span { /* header text color */
color: #eee;
}
/* Define the Section type 3 */
.bg-3 {
min-height: 100vh;
background-color: #fff;
overflow: auto;
color: #222;
} .bg-3 h1 { /* Underline color */
color: #39f;
} .bg-3 span { /* header text color */
color: #222;
} .bg-3 iframe {
height: auto;
width: auto;
padding: 10px;
margin: auto;
}
.bg-footer {
background-color: #444;
color: #fff;
height: 5em;
padding-top: 2em;
font-size: 1em;
}
</style>
</head>
<body data-spy="scroll" data-target=".navbar">
<!-- Navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left">
<li>Home</li>
<li>About</li>
<li>Interests and Specialities</li>
<li>Insurance</li>
<li>Contact</li>
<li>Resources</li>
</ul>
</div>
</div>
</nav>
<!-- First Container -->
<div id="Home" class="container-fluid bg-head">
<row>
<div class="col-sm-4"></div>
<div class="col-sm-4">
<img src="test1.png" class="img-responsive img-circle margin center" style="display:inline" alt="Parish Counseling Service" width="350" height="350"/>
</div>
<div class="col-sm-4"> </div>
</row>
<row>
<div class="col-sm-2"></div>
<div class="col-sm-8">
<p>
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
</p>
</div>
<div class="col-sm-2"> </div>
</row>
</div>
<!-- Second Container -->
<div id="About" class="container-fluid bg-1">
<row class="text-center">
<div class="col-sm-1"></div>
<div class="col-sm-10"><h1><span>About Me<span></h1></div>
<div class="col-sm-1"></div>
</row>
<row>
<div class="col-sm-3"></div>
<div class="col-sm-6">
<img src="test2.png" class="img-responsive margin" align="left" alt="Greg" width="200" height="200">
<p>
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
</p>
</div>
<div class="col-sm-3"></div>
</row>
</div>
<!-- Third Container (Grid) -->
<div id="Interests" class="container-fluid bg-2">
<row class="text-center">
<div class="col-sm-1"></div>
<div class="col-sm-10"><h1><span>Areas of interests and specializations<span></h1></div>
<div class="col-sm-1"></div>
</row>
<row>
<div class="col-sm-2"></div>
<div class="col-sm-4">
<ul>
<li>Daddy Bender, we're hungry.</li>
<li>There's one way and only one way to determine if an animal is intelligent.</li>
<li>Dissect its brain!</li>
<li>You mean while I'm sleeping in it?</li>
<li>Who am I making this out to?</li>
<li>We can't compete with Mom!</li>
<li>Her company is big and evil!</li>
<li>Ours is small and neutral!</li>
</ul>
</div>
<div class="col-sm-4">
<ul>
<li>Daddy Bender, we're hungry.</li>
<li>There's one way and only one way to determine if an animal is intelligent.</li>
<li>Dissect its brain!</li>
<li>You mean while I'm sleeping in it?</li>
<li>Who am I making this out to?</li>
<li>We can't compete with Mom!</li>
<li>Her company is big and evil!</li>
<li>Ours is small and neutral!</li>
</ul>
</div>
<div class="col-sm-2"></div>
</row>
</div>
<!-- Forth Container (Grid) -->
<div id="Insurance" class="container-fluid bg-1">
<row class="text-center">
<div class="col-sm-2"></div>
<div class="col-sm-8"><h1><span>Accepting fees and Insurance<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-3"></div>
<div class="col-sm-6">
<p>
Morbo can't understand his teleprompter because he forgot how you say that letter that's shaped like a man wearing a hat. Oh Leela! You're the only person I could turn to; you're the only person who ever loved me.
Anyone who laughs is a communist! There's no part of that sentence I didn't like! Tell them I hate them. Bite my shiny metal ass. So I really am important? How I feel when I'm drunk is correct.
I found what I need. And it's not friends, it's things. Kids don't turn rotten just from watching TV. Kif, I have mated with a woman. Inform the men. Yes, except the Dave Matthews Band doesn't rock. Tell her she looks thin.
</p>
<p>
option1 <br>
option1 <br>
option1 <br>
option1 <br>
</p>
</div>
<div class="col-sm-3"></div>
</row>
</div>
<!-- Fifth Container (Grid) -->
<div id="Contact" class="container-fluid bg-3">
<row class="text-center">
<div class="col-sm-2"></div>
<div class="col-sm-8"><h1><span>Location and Contact Information<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-2"> <span> </span> </div>
<div class="col-sm-8">
<row>
<div class="col-sm-6"> <!-- Contact Email -->
Bender?! You stole the atom.<br>
You lived before you met me?! <br><br>
We're also Santa Claus! <br>
I had more, but you go ahead. <br><br>
Professor, make a woman out of me.<br>
</div>
<div class="col-sm-6"> <!-- Embeded Map -->
<iframe
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key=AIzaSyBV0yLhoKn-BsyktBdZpla1VKfOCikqzgQ&q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>
</div>
</row>
<row>
<form>
<div class="col-sm-4"> <!-- Name, Email, Subject -->
<div class="form-group">
<input type="text" class="form-control" placeholder="Name">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Subject">
</div>
</div>
<div class="col-sm-8"> <!-- Message, Send -->
<div class="form-group">
<textarea class="form-control" rows="3" placeholder="Message" width="100%"></textarea>
</div>
<div class="form-group">
<button width="100%" type="submit" class="btn btn-default" >Send</button>
</div>
</div>
</form>
</row>
</div>
<div class="col-sm-2"><span> </span></div>
</row>
</div>
<!-- Sixth Container (Grid) -->
<div id="Resources" class="container-fluid bg-1 text-center">
<row>
<div class="col-sm-2"></div>
<div class="col-sm-8"><h1><span>Resources<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-12">
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Soon enough. <br><br>
You lived before you met me?! <br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Fry! <br><br>
Stay back! He's too powerful! <br>
I guess if you want children beaten, you have to do it yourself.<br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Soon enough. <br><br>
You lived before you met me?! <br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Fry! <br><br>
</div>
</row>
</div>
<footer class="container-fluid bg-footer text-center">
No Worries
</footer>
</body>
</html>
I used Futurama Stuff got the dummy material. Here is what I am seeing:
Both should have a column of size 2 centering them
bg-head
bg-3
I have never seen a <row> tag.
If you use bootstrap row class with div this will work. Replace your <row> with <div class="row"> (and replace </row> with </div>)
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
/* define the headers for each section */
h1 {
margin: auto;
padding-top: 10%;
padding-bottom: 5%;
text-decoration: underline;
}
h1:before {
content: "\00a0\00a0";
}
h1:after {
content: "\00a0\00a0";
}
span {
color: #111;
text-decoration: none;
z-index: 1;
}
/* Define the Nav Bar */
.navbar {
padding-top: 5px;
padding-bottom: 5px;
background-color: #9fc;
width: 100%;
border: solid;
border-bottom-width: 2px;
border-color: white;
}
li:hover {
background-color: #7da;
}
.dropbtn {
/* Dropdown Button */
padding: 16px;
border: none;
cursor: pointer;
}
.dropdown {
/* The container <div> - needed to position the dropdown content */
position: relative;
display: inline-block;
}
.dropdown-content {
/* Dropdown Content (Hidden by Default) */
display: none;
position: absolute;
background-color: #9fc;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
border: solid;
border-top-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
border-color: white;
z-index: 1;
}
.dropdown-content a {
/* Links inside the dropdown */
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
border: solid;
border-bottom-width: 1px;
border-color: white;
}
.dropdown-content a:hover {
/* Change color of dropdown links on hover */
background-color: #f1f1f1
}
.dropdown:hover .dropdown-content {
/* Show the dropdown menu on hover */
display: block;
}
/* Home section of the page */
.bg-head {
min-height: 100vh;
background-image: url(bgtest.jpg);
overflow: auto;
}
.bg-head img {
padding-top: 15vh;
padding-bottom: 10px;
}
.bg-head p {
background-color: white;
opacity: 0.8;
padding: 10px;
}
.bg-head .center {
margin: auto;
}
/* Define the Section type 1 */
.bg-1 {
min-height: 100vh;
background-color: #39f;
color: #222;
overflow: auto;
}
.bg-1 h1 {
/* Underline color */
color: #fff;
}
.bg-1 span {
/* header text color */
color: #222;
}
.bg-1 img {
padding: 5px;
}
/* Define the Section type 2 */
.bg-2 {
min-height: 100vh;
background-color: #222;
color: #eee;
overflow: auto;
}
.bg-2 h1 {
/* Underline color */
color: #39f;
}
.bg-2 span {
/* header text color */
color: #eee;
}
/* Define the Section type 3 */
.bg-3 {
min-height: 100vh;
background-color: #fff;
overflow: auto;
color: #222;
}
.bg-3 h1 {
/* Underline color */
color: #39f;
}
.bg-3 span {
/* header text color */
color: #222;
}
.bg-3 iframe {
height: auto;
width: auto;
padding: 10px;
margin: auto;
}
.bg-footer {
background-color: #444;
color: #fff;
height: 5em;
padding-top: 2em;
font-size: 1em;
}
</style>
</head>
<body data-spy="scroll" data-target=".navbar">
<!-- Navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left">
<li>Home</li>
<li>About</li>
<li>Interests and Specialities</li>
<li>Insurance</li>
<li>Contact</li>
<li>Resources</li>
</ul>
</div>
</div>
</nav>
<!-- First Container -->
<div id="Home" class="container-fluid bg-head">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<img src="test1.png" class="img-responsive img-circle margin center" style="display:inline" alt="Parish Counseling Service" width="350" height="350" />
</div>
<div class="col-sm-4"> </div>
</div>
<div class="row">
<div class="col-sm-2"></div>
<div class="col-sm-8">
<p>
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug you can just rub onto your skin? You'd think it would be something you'd have to freebase. Well, then good news! It's a suppository. Okay, it's 500 dollars, you have no choice of carrier,
the battery can't hold the charge and the reception isn't very… Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug you can just rub onto your skin? You'd think it would be something you'd have to freebase. Well, then good news!
It's a suppository. Okay, it's 500 dollars, you have no choice of carrier, the battery can't hold the charge and the reception isn't very…
</p>
</div>
<div class="col-sm-2"> </div>
</div>
</div>
<!-- Second Container -->
<div id="About" class="container-fluid bg-1">
<row class="text-center">
<div class="col-sm-1"></div>
<div class="col-sm-10">
<h1><span>About Me<span></h1></div>
<div class="col-sm-1"></div>
</row>
<row>
<div class="col-sm-3"></div>
<div class="col-sm-6">
<img src="test2.png" class="img-responsive margin" align="left" alt="Greg" width="200" height="200">
<p>
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
Fry! Quit doing the right thing, you jerk! Wow! A superpowers drug
you can just rub onto your skin? You'd think it would be something
you'd have to freebase. Well, then good news! It's a suppository.
Okay, it's 500 dollars, you have no choice of carrier, the battery
can't hold the charge and the reception isn't very…
</p>
</div>
<div class="col-sm-3"></div>
</row>
</div>
<!-- Third Container (Grid) -->
<div id="Interests" class="container-fluid bg-2">
<row class="text-center">
<div class="col-sm-1"></div>
<div class="col-sm-10"><h1><span>Areas of interests and specializations<span></h1></div>
<div class="col-sm-1"></div>
</row>
<row>
<div class="col-sm-2"></div>
<div class="col-sm-4">
<ul>
<li>Daddy Bender, we're hungry.</li>
<li>There's one way and only one way to determine if an animal is intelligent.</li>
<li>Dissect its brain!</li>
<li>You mean while I'm sleeping in it?</li>
<li>Who am I making this out to?</li>
<li>We can't compete with Mom!</li>
<li>Her company is big and evil!</li>
<li>Ours is small and neutral!</li>
</ul>
</div>
<div class="col-sm-4">
<ul>
<li>Daddy Bender, we're hungry.</li>
<li>There's one way and only one way to determine if an animal is intelligent.</li>
<li>Dissect its brain!</li>
<li>You mean while I'm sleeping in it?</li>
<li>Who am I making this out to?</li>
<li>We can't compete with Mom!</li>
<li>Her company is big and evil!</li>
<li>Ours is small and neutral!</li>
</ul>
</div>
<div class="col-sm-2"></div>
</row>
</div>
<!-- Forth Container (Grid) -->
<div id="Insurance" class="container-fluid bg-1">
<row class="text-center">
<div class="col-sm-2"></div>
<div class="col-sm-8"><h1><span>Accepting fees and Insurance<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-3"></div>
<div class="col-sm-6">
<p>
Morbo can't understand his teleprompter because he forgot how you say that letter that's shaped like a man wearing a hat. Oh Leela! You're the only person I could turn to; you're the only person who ever loved me.
Anyone who laughs is a communist! There's no part of that sentence I didn't like! Tell them I hate them. Bite my shiny metal ass. So I really am important? How I feel when I'm drunk is correct.
I found what I need. And it's not friends, it's things. Kids don't turn rotten just from watching TV. Kif, I have mated with a woman. Inform the men. Yes, except the Dave Matthews Band doesn't rock. Tell her she looks thin.
</p>
<p>
option1 <br>
option1 <br>
option1 <br>
option1 <br>
</p>
</div>
<div class="col-sm-3"></div>
</row>
</div>
<!-- Fifth Container (Grid) -->
<div id="Contact" class="container-fluid bg-3">
<row class="text-center">
<div class="col-sm-2"></div>
<div class="col-sm-8"><h1><span>Location and Contact Information<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-2"> <span> </span> </div>
<div class="col-sm-8">
<row>
<div class="col-sm-6">
<!-- Contact Email -->
Bender?! You stole the atom.<br> You lived before you met me?! <br><br> We're also Santa Claus! <br> I had more, but you go ahead. <br><br> Professor, make a woman out of me.<br>
</div>
<div class="col-sm-6">
<!-- Embeded Map -->
<iframe frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyBV0yLhoKn-BsyktBdZpla1VKfOCikqzgQ&q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>
</div>
</row>
<row>
<form>
<div class="col-sm-4">
<!-- Name, Email, Subject -->
<div class="form-group">
<input type="text" class="form-control" placeholder="Name">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Email">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Subject">
</div>
</div>
<div class="col-sm-8">
<!-- Message, Send -->
<div class="form-group">
<textarea class="form-control" rows="3" placeholder="Message" width="100%"></textarea>
</div>
<div class="form-group">
<button width="100%" type="submit" class="btn btn-default">Send</button>
</div>
</div>
</form>
</row>
</div>
<div class="col-sm-2"><span> </span></div>
</row>
</div>
<!-- Sixth Container (Grid) -->
<div id="Resources" class="container-fluid bg-1 text-center">
<row>
<div class="col-sm-2"></div>
<div class="col-sm-8">
<h1><span>Resources<span></h1></div>
<div class="col-sm-2"></div>
</row>
<row>
<div class="col-sm-12">
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Soon enough. <br><br>
You lived before you met me?! <br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Fry! <br><br>
Stay back! He's too powerful! <br>
I guess if you want children beaten, you have to do it yourself.<br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Soon enough. <br><br>
You lived before you met me?! <br><br>
Bender, hurry! This fuel's expensive! <br>
Also, we're dying! Fry! <br><br>
</div>
</row>
</div>
<footer class="container-fluid bg-footer text-center">
No Worries
</footer>
</body>
</html>

Color change on hover over multiple elements

I want to apply one for all hover color change effect on the icon, text and button(top to bottom). At the moment hover is working separately either text and icon or button is changing color.
here is the code and also a fiddle
<div class="col-1-left">
<div class="content">
<div class="icon">
<img src="#" />
</div>
<div class="text">
<h4>
Title text
</h4>
</div>
</div>
<div class="button">
Read More
</div>
</div>
.col-1-left {
width: 100%;
background: #555;
padding: 10px;
margin: 0;
color: red;
}
.col-1-left:hover {
color: white;
}
.button a {
color: #000;
}
.button a:hover {
color: white;
}
EDIT:
Although some of the answers worked on jsfiddle, none of them worked so far on live site.. I am pasting updated HTML code structure from it as the one above was only a sample. Maybe that will help sorting this issue out. Thanks!
<div class="et_pb_column et_pb_column_1_3 col-1-left et_pb_column_93 cboxElement">
<div class="et_pb_blurb et_pb_module et_pb_bg_layout_light et_pb_text_align_center mp_m_blurb_pulse fins-color-aqua et_pb_blurb_50 et_pb_blurb_position_top">
<div class="et_pb_blurb_content">
<div class="et_pb_main_blurb_image">
<span class="et-pb-icon et-waypoint et_pb_animation_off et-animated" style="color: #28375c;">?</span>
</div>
<div class="et_pb_blurb_container">
<h4>Title</h4>
<h5>Subhead</h5>
</div>
</div>
</div>
<div class="et_pb_button_module_wrapper et_pb_module et_pb_button_alignment_center">
<a class="et_pb_button et_pb_button_26 et_pb_module et_pb_bg_layout_dark" href="#">Find Out More</a>
</div>
</div>
Please Try this,
.col-1-left:hover * {
color: white;
}
I did a code snippet for you. Please try it and confirm it is what you need.
The thing is that you need to add the hover effect to the parent, i.e. .col-1-left in order to be able to change the color to its children elements.
.col-1-left {
width: 100%;
background: #555;
padding: 10px;
margin: 0;
color: red;
}
.col-1-left:hover, .col-1-left:hover .button a {
color: white;
}
.button a {
color:#000;
}
<div class="col-1-left">
<div class="content">
<div class="icon">
<img src="#" />
</div>
<div class="text">
<h4>Title text</h4>
</div>
</div>
<div class="button">
Read More
</div>
</div>