css3 menu with inverse rounded corners - html

I designed a navigation menu which looks like the image here:
I want to code it with css3 rounded corners and box-shadows, not using any images.
Problem is the rounded corner to the left of the first menu-item, and the one to the right of the menu... I call it a "reverse" rounded corner...
It should have to change color on :hover.
Is there any way to get this done in css only? And how?

HTML
<div class="menu">
<div class="outer_bg_left">
<div class="outer">
<div class="outer_shadow">
</div>
</div>
</div>
<ul>
<li class="menu_item_cont"><div class="menu_item">Item 1</div></li>
<li class="menu_item_cont"><div class="menu_item">Item 2</div></li>
<li class="menu_item_cont"><div class="menu_item">Item 3</div></li>
</ul>
<div class="outer_bg_right">
<div class="outer">
<div class="outer_shadow">
</div>
</div>
</div>
</div>
CSS
.outer_bg_left, .outer_bg_right {
float: left;
width: 70px;
background-color: #994;
height: 15px;
overflow: hidden;
position: relative;
z-index: 10;
}
.outer_bg_left .outer {
height: 25px;
border-radius: 0 10px 0 0;
background-color: #fff;
}
.outer_bg_right .outer {
height: 25px;
border-radius: 10px 0 0 0;
background-color: #fff;
}
.outer_bg_left .outer_shadow, .outer_bg_right .outer_shadow {
box-shadow: 0 0 5px 2px rgba(0,0,0, .7) inset;
padding-bottom: 10px;
margin-bottom: -10px;
height: 25px;
}
.outer_bg_left .outer_shadow {
border-radius: 0 10px 0 0;
padding-left: 30px;
margin-left: -30px;
}
.outer_bg_right .outer_shadow {
border-radius: 10px 0px 0 0;
padding-right: 30px;
margin-right: -30px;
}
.menu_item_cont {
background-color: #994;
border-radius: 0 0 10px 10px;
box-shadow: 0 0 5px 2px rgba(0,0,0, .7);
background-color: #994;
display: block;
float: left;
}
.menu_item {
border-radius: 0 0 10px 10px;
background-color: #994;
height: 20px;
padding: 5px 10px;
font-family: Arial;
line-height: 20px;
font-size: 14px;
font-weight: bold;
}
.menu_item:hover {
background-color: #000;
border-radius: 10px;
height: 30px;
line-height: 30px;
color: #fff;
}
http://jsfiddle.net/gXQzU/4/
It's just my first attempt, but I think it looks quite promising.

Related

How to move the horizontal line beneath the title?

I am trying to put the horizontal bar beneath the text title where is inside of the container <div> but the horizontal bar just effect in the width, but not moving up to the position...
I am hesitating that should I create one more div. I have been trying to move up the hr by top with vh or even margin, but that is not workable.
What I want is to move the hr below the title.
How I want the hr to move up
Original
.topcon {
background-color: #f6f5f5;
position: relative;
width: 250px;
height: 250px;
border: 15px;
padding: 50px;
margin: 180px auto 150px auto;
border-radius: 20px;
}
.pattern-card {
position: relative;
right: 50px;
border-radius: 20px 20px 0px 0px;
bottom: 50px;
}
.victor {
position: relative;
background-color: #ffffff;
border: 3px solid #ffffff;
border-radius: 50%;
display: inline-block;
margin-left: 50px;
margin-right: auto;
bottom: 110px;
width: 50%;
}
.user-name {
position: absolute;
width: 30%;
left: 20vh;
top: 40vh;
text-align: center;
display: inline;
margin: 0 auto 0 auto;
font-family: "Kumbh Sans", sans-serif;
font-weight: 700;
color: #2d3248;
font-size: 18px;
}
.user-age {
position: absolute;
width: 20%;
right: 15.5vh;
top: 40vh;
text-align: center;
display: inline;
margin: 0 auto 0 auto;
font-family: "Kumbh Sans", sans-serif;
font-weight: 700;
color: #969696;
font-size: 18px;
}
.user-location {
position: absolute;
width: 25%;
left: 22.5vh;
top: 45.5vh;
text-align: center;
display: inline;
margin: 0 auto 0 auto;
font-family: "Kumbh Sans", sans-serif;
font-weight: 700;
color: #969696;
}
hr {
border-top: 1px solid #969696;
width: 100%;
bottom: 50vh;
}
<div class="topcon">
<img class="pattern-card" src="images/bg-pattern-card.svg" alt="pattern card at the frame." />
<img class="victor" src="images/image-victor.jpg" alt="image for Victor" />
<p class="user-name">Victor Crest</p>
<p class="user-age">26</p>
<p class="user-location">London</p>
<hr /> 80K Followers 803K Likes 1.4K Photos
</div>
Try with this
hr{
border-top: 1px solid #969696;
margin-left: -50px;
width: 350px;
margin-top: -15px;
}
change the margin top and width and margin left according to your div width and height
You can also dismiss the horizontal ruler (line) entirely, and use CSS border-top. I tried and got this:
body {
font-family: "Open Sans", sans-serif;
}
body * {
box-sizing: border-box;
}
.card {
width: 300px;
height: 320px;
margin: 20px auto;
overflow: hidden;
text-align: center;
display: flex;
flex-direction: column;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.11);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.11);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.11);
}
.card-header {
height: 105px;
background: #44d3d9;
}
.card-image {
margin-top: -50px;
}
.card-image img {
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 100px;
height: auto;
border: 4px solid #fff;
}
.card-content h2 {
font-size: 14px;
margin-bottom: 5px;
}
.card-content h2 span {
color: #6d6d6d;
padding-left: 6px;
}
.card-content .location {
margin: 0;
font-size: 13px;
color: #6d6d6d;
}
.card-footer {
display: flex;
margin-top: auto;
height: 90px;
border-top: 1px solid #efefef;
}
.card-footer > div {
flex-grow: 1;
display: flex;
flex-direction: column;
border-right: 1px solid #efefef;
}
.card-footer > div:last-child {
border-right: none;
}
.card-footer ul {
margin: auto 0;
padding: 0;
list-style-type: none;
}
.card-footer ul li {
color: #6d6d6d;
font-size: 11px;
}
.card-footer ul li.count {
color: #111111;
font-size: 16px;
font-weight: 600;
}
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<div class="card">
<div class="card-header"></div>
<div class="card-image">
<img src="https://randomuser.me/api/portraits/men/91.jpg" alt="">
</div>
<div class="card-content">
<h2>Victor Crest <span>26</span></h2>
<p class="location">London</p>
</div>
<div class="card-footer">
<div>
<ul>
<li class="count">80K</li>
<li>Folowers</li>
</ul>
</div>
<div>
<ul>
<li class="count">803K</li>
<li>Likes</li>
</ul>
</div>
<div>
<ul>
<li class="count">1.4K</li>
<li>Photos</li>
</ul>
</div>
</div>
</div>

Html5 Border-Radius Reverse Fill

I want to achieve drop-down button as per following design image. See drop-down menu starts just after middle of button. My problem is that button has transparent background to utilize background image from root parent div.
So far I have achieved following image. As I said above, I want to achieve white edges outside of border-radius.
.dropdown-header {
border-top-left-radius: 20px;
border-top-right-radius: 20px;
width: 210px;
height: 185px;
margin: auto;
}
.div-user-header {
width: 210px;
margin: auto;
position: relative;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.div-user-header-1 {
width: 206px;
height: 24px;
border: 2px solid #9CB2C7;
border-radius: 20px;
display: inline-block;
text-align: center;
padding-top: 5px;
}
.div-user-header-1 a {
text-decoration: none;
color: #FCCC00;
display: block;
}
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
}
.div-user-header-2 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-2 {
height: 40px;
padding: 12px 15px;
}
.div-user-header-3 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-3 {
height: 40px;
padding: 12px 15px;
}
.div-add-profile-card {
padding: 0px 15px;
}
.div-add-profile-card a {
text-decoration: none;
color: #8C8C8C;
font-size: 10px;
padding: 12px;
display: block;
border-top: 1px solid #D6D6D6;
}
<div class="dropdown-header">
<div class="div-user-header">
<div class="div-user-header-1">
ProfileUser 01
</div>
<div class="div-user-header-list">
<div class="div-user-header-2">
<img src="../../../assets/images/avtar2.png" width="34px" height="34px" style="padding-right: 5px; vertical-align: middle" />
ProfileUser 01
</div>
<div class="div-user-header-3">
<img src="../../../assets/images/user-02.png" width="30px" height="30px" style="padding-right:5px; vertical-align: middle" />
ProfileUser 02
</div>
<div class="div-add-profile-card">
+ Add Profile Cards
</div>
</div>
</div>
Any suggestion would be really helpful.
Use ::after ::before pseudo elements for the dropdown and apply separate background-image as marked in the image. Apply position:absolute and align then in the top left and right corners based on the design.
It's very simple. You have achieved almost 99%. Just add below styles to your CSS of .div-user-header-list as below:
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
padding-top: 20px;
margin-top: -20px;
z-index: -1;
}
See the updated fiddle here: https://jsfiddle.net/8ukj3wy1/1/
Check this one out:
https://jsfiddle.net/sLy7fnzg/
Essentially use a negative margin to move the .div-user-header-list up and use relative positioning to enable z-indexes.
Also, to resolve the issue with the half border, remove the border from the .div-user-header-1 and add a whole element as a ::before to the .div-user-header like so:
.div-user-header::before {
content: "";
background: #9CB2C7;
width: 210px;
height: 30px;
display:block;
position: absolute;
top: 0;
left: 0;
border-radius: 20px;
z-index: 1;
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<style>
body{
background-color: grey;
}
.dropdown-header {
border-top-left-radius: 20px;
border-top-right-radius: 20px;
width: 210px;
height: 203px;
margin: auto;
overflow: hidden;
/*background-color: #fff;*/
}
.div-user-header-list:before,
.div-user-header-list:after {
content: "";
position: absolute;
height: 10px;
width: 20px;
bottom: 0;
}
.div-user-header-list:before {
/*right: -20px;*/
left: 1px;
top: -10px;
border-radius: 0 0 0 10px;
-moz-border-radius: 0 0 0 10px;
-webkit-border-radius: 0 0 0 10px;
-webkit-box-shadow: -10px 0 0 0 #fff;
box-shadow: -10px 0 0 0 #fff;
}
.div-user-header-list:after {
/*left: -20px;*/
right: 1px;
top: -10px;
border-radius: 0 0 10px 0;
-moz-border-radius: 0 0 10px 0;
-webkit-border-radius: 0 0 10px 0;
-webkit-box-shadow: 10px 0 0 0 #fff;
box-shadow: 10px 0 0 0 #fff;
}
.div-user-header {
width: 210px;
margin: auto;
position: relative;
border-radius: 20px;
}
.div-user-header-1 {
width: 206px;
height: 24px;
border: 2px solid #9CB2C7;
border-radius: 20px;
display: inline-block;
text-align: center;
padding-top: 5px;
}
.div-user-header-1 a {
text-decoration: none;
color: #FCCC00;
display: block;
}
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
/*margin-top: -14px;
z-index: -9;
padding-top: 14px;*/
}
.div-user-header-2 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-2 {
height: 40px;
padding: 12px 15px;
}
.div-user-header-3 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-3 {
height: 40px;
padding: 12px 15px;
}
.div-add-profile-card {
padding: 0px 15px;
}
.div-add-profile-card a {
text-decoration: none;
color: #8C8C8C;
font-size: 10px;
padding: 12px;
display: block;
border-top: 1px solid #D6D6D6;
}
</style>
</head>
<body>
<div class="dropdown-header">
<div class="div-user-header">
<div class="div-user-header-1">
ProfileUser 01
</div>
<div class="div-user-header-list">
<div class="div-user-header-2">
<img src="../../../assets/images/avtar2.png" width="34px" height="34px" style="padding-right: 5px; vertical-align: middle" />
ProfileUser 01
</div>
<div class="div-user-header-3">
<img src="../../../assets/images/user-02.png" width="30px" height="30px" style="padding-right:5px; vertical-align: middle" />
ProfileUser 02
</div>
<div class="div-add-profile-card">
+ Add Profile Cards
</div>
</div>
</div>
</body>
</html>

overlapping css when resizing browser

I am making my first webpage and am having trouble positioning elements. They keep overlapping each other when I resize the browser. The title is positioned absolute, but this means it overlaps the image at the top. I cant get it into position by any other means. Can anyone help?
here is the html:
<!DOCTYPE html>
<html>
<head>
<title>Guitar Lessons</title>
<link href="./bio.css" type="text/css" rel="stylesheet" media="all">
</head>
<body>
<div class="header">
<img src="C:\Users\Duncan\Desktop\Coding\Images\guitar_banner.jpg" alt="Dunc's guitar lessons in Isleworth"/>
<div class="cont">
<div class="top-left">Dunc's<br/> Guitar<br/> Lessons</div>
</div>
<nav class="navigation">
<ul>
<li><p class="first">About Me</p></li>
<li><p class="second">My Music</p></li>
<li><p class="third">FAQ</p></li>
<li><p class="fourth">Prices</p></li>
<li><p class="fifth">Contact</p></li>
</ul>
</nav>
</header>
<h2 id="bio">My Bio</h2>
<p class="bio">Hello! I am Duncan – famous for imparting my guitar knowledge on the residents of Isleworth. I have been playing the guitar for over ten years and can navigate<br/> the fretboard confidently. I am completely self-taught, and it’s been a real learning curve which I am keen to pass on to others wishing to learn the guitar. Through<br/> my learning experience, I realise the value of having human interaction and feedback whilst learning. I am a very patience teacher, which makes me<br/> suitable for teaching beginners.<br/><br/>
My musical influences are based heavily on the blues, and my favourite guitarists include Peter Green, Muddy Waters, B.B. King, Jimmy Page, Eric Clapton,<br/> Wilko Johnson and Jimmy Hendrix. I have recently started to write my own music, with the aim one day of recording properly and creating a short album.
</p>
<h2 id="lessons">Lesson Content</h2>
<p class="content">I specialise in taking complete beginners through the different aspects of playing the guitar and I aim to have you confident and skilled enough to play a<br/> short piece of music (something other than a nursery rhyme!) within just three lessons. Aspects of playing my lessons cover include:</p>
<ul class="lessons">
<li>Basic open chord shapes</li>
<li>Strumming patterns and rhythm</li>
<li>Learning notes on the fret board</li>
<li>Lead techniques and single note lines</li>
<li>Advice on gear and the best guitars to buy</li>
</ul>
<p class="content">Practice makes perfect, and you are given homework between each lesson to play on your guitar.</p><br/><br/>
<div class="guitar">
<img src="C:\Users\Duncan\Desktop\Coding\Images\guitar.jpg" />
</div>
<br/>
<p class="copyright">Copyright Duncan Hammett 2018</p><br/>
</body>
here is the css:
nav li {
display: inline-block;
padding: 50px;
}
.first {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
font-size: 28px;
}
.first:hover {
color: teal;
}
.second {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
font-size: 28px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.second:hover {
color: teal;
}
.third {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
font-size: 28px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.third:hover {
color: teal;
}
.fourth {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
font-size: 28px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.fourth:hover {
color: teal;
}
.fourth {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
font-size: 28px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.fifth {
width: 200px;
height: 40px;
border: 2px solid maroon;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
border-radius: 10px;
background-color: maroon;
color: white;
font-size: 28px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.fifth:hover {
color: teal;
}
.header img {
width: 1440px;
height: 400px;
position: relative;
left: 240px;
min-width: 1440px;
max-width: 1440px;
min-height: 400px;
max-height: 400px;
}
.cont {
position: relative;
}
.top-left {
position: absolute;
top: 11px;
left: 12px;
color: teal;
font-size: 124px;
}
body {
font-family: Helvetica;
text-align: center;
font-size: 20px;
}
.guitar img {
width: 1100px;
height: 600px;
position: static;
min-width: 1100px;
max-width: 1100px;
min-height: 600px;
max-height: 600px;
}
.bio {
line-height: 1.6;
color: teal;
}
.content {
line-height: 1.6;
color: teal;
}
.lessons {
line-height: 1.6;
list-style-position: inside;
color: teal;
}
.copyright {
color: teal;
font-size: 16px;
}

Align image and 2 text lines

I'm trying to align this div so that the image appear first and then the 2 lines after, however i cant seem to make it align proberly.
#overview {
width: 350px;
height: 500px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
#overview #header-collapse {
height: 50px;
width: 100%;
background-color: #ff8217;
color: #fff;
font-size: 15px;
line-height: 50px;
white-space: nowrap;
-moz-border-radius: 0px;
-webkit-border-radius: 3px 3px 0px 0px;
border-radius: 3px 3px 0px 0px;
text-align: center;
}
#overview #body-list {
background: #fff;
height:450px;
overflow-y: auto;
width: 100%;
border-radius: 0px 0px 3px 3px;
-webkit-border-radius: 0px 0px 3px 3px;
border-radius: 0px 0px 3px 3px;
}
#overview #body-list a {
text-decoration:none;
}
.list-item:hover {
background-color: rgba(82, 82, 82, .1);
}
.list-item {
border-bottom: 1px solid rgba(82, 82, 82, .2);
height: 80px;
width: 100%;
padding-left: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
}
.list-item p {
margin: 0px;
}
.list-item #header-title {
color: #954500;
font-size: 20px;
font-weight: 400;
}
.list-item #subtitle {
color: rgb(82, 82, 82);
opacity: 0.6;
font-size: 13px;
}
.list-item #list-image {
height: 60px;
width: 60px;
background-color: #000;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
<div id="overview">
<div id="header-collapse">
<h4>
Oversigt
</h4>
</div>
<div id="body-list">
<a href="#">
<div class="list-item">
<div id="list-image"></div>
<p id="header-title">Title</p>
<p id="subtitle">Subtitle</p>
</div>
</a>
</div>
</div>
The easiest, and most modern way is to use flexbox.
With this method, the image circle and the text will both be centered vertically, so you don't have to worry about it later.
Place your header-title and subtitle inside of a div.
<div class="list-titles">
<p id="header-title">Title</p>
<p id="subtitle">Subtitle</p>
</div>
Then add the following to your .list-item class:
.list-item {
display: flex;
align-items: center;
}
(I also added margin-right: 10px; to your image so it looks better xD)
Here is a working JSFiddle
Add float:left to that div.
.list-item #list-image {float:left;}
Working JSFIDDLE
Wrap the two titles in a new DIV, then define that new DIV and the DIV of the image as inline-blocks, like this: (you'll have to finetune the margins for distances)
#overview {
width: 350px;
height: 500px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
#overview #header-collapse {
height: 50px;
width: 100%;
background-color: #ff8217;
color: #fff;
font-size: 15px;
line-height: 50px;
white-space: nowrap;
-moz-border-radius: 0px;
-webkit-border-radius: 3px 3px 0px 0px;
border-radius: 3px 3px 0px 0px;
text-align: center;
}
#overview #body-list {
background: #fff;
height:450px;
overflow-y: auto;
width: 100%;
border-radius: 0px 0px 3px 3px;
-webkit-border-radius: 0px 0px 3px 3px;
border-radius: 0px 0px 3px 3px;
}
#overview #body-list a {
text-decoration:none;
}
.list-item:hover {
background-color: rgba(82, 82, 82, .1);
}
.list-item {
border-bottom: 1px solid rgba(82, 82, 82, .2);
height: 80px;
width: 100%;
padding-left: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
}
.list-item p {
margin: 0px;
}
.list-item #header-title {
color: #954500;
font-size: 20px;
font-weight: 400;
}
.list-item #subtitle {
color: rgb(82, 82, 82);
opacity: 0.6;
font-size: 13px;
}
.list-item #list-image {
height: 60px;
width: 60px;
background-color: #000;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
#list-image, #title-wrapper {
display: inline-block;
}
<div id="overview">
<div id="header-collapse">
<h4>
Oversigt
</h4>
</div>
<div id="body-list">
<a href="#">
<div class="list-item">
<div id="list-image"></div>
<div id="title-wrapper">
<p id="header-title">Title</p>
<p id="subtitle">Subtitle</p>
</div>
</div>
</a>
</div>
</div>

How to make background-color in the sidebars be as long as the textarea? (simple grid made by myself)

I have a problem. I'm making a simple website, with simple javascript code, that is based on the assumption, that when the user click the button, some lines are added. Everything works perfectly, beside the part with backgrund color of sidebards. When I add another line to the site, col-1 background is not working, I can only see white place (I've made simple grid by myself). More: there is no color at all, all the time. Maybe someone here knows how to fixed it?
<section class="grid-container section1">
<div class="row">
<div class="col-1">
</div>
<div class="col-10">
<div class="talking-div">
<ul class="talk">
<li class="animate-talk">text!</li><br>
<li>text.</li><br>
<li>text.</li><br>
</ul>
</div>
<div class="talking-button">
<div class="books answer">text.</div>
<div class="celestia answer">text.</div>
</div>
</div>
<div class="col-1">
</div>
</div>
</section>
CSS styling:
.grid-container {
width: 100%;
max-width: 1600px;
margin: 0 auto;
overflow: hidden;
}
.row&:after, .row&:before {
content: "";
display: table;
clear: both;
}
.col-1 {
float: left;
min-height: 1px;
background-color: #87cefa;
}
.col-10 {
float: left;
min-height: 1px;
background-color: #E1FEFA;
}
li {
display: inline-block;
line-height: 1.45em;
border-radius: 3px;
margin: 0 0 1.5em 2em;
text-align: left;
padding: 6px 12px;
background: #eb4492;
font-size: 19px;
max-width: 90%;
min-width: 44px;
min-height: 12px;
-webkit-box-shadow: 0 0 1px rgba(0,0,0,0.2);
-moz-box-shadow: 0 0 1px rgba(0,0,0,0.2);
box-shadow: 0 0 1px rgba(0,0,0,0.2);
}
.talking-button {
text-align: center;
padding: 2%;
}
.answer {
cursor: pointer;
background-color: #1b3669;
margin: 12px 6px;
display: inline-block;
line-height: 1.45em;
border-radius: 3px;
color: #CCE6FF;
text-align: left;
position: relative;
padding: 6px 12px;
-webkit-box-shadow: 0 0 1px rgba(0,0,0,0.2);
-moz-box-shadow: 0 0 1px rgba(0,0,0,0.2);
box-shadow: 0 0 1px rgba(0,0,0,0.2);
font-size: 19px;
border: none;
max-width: 90%;
min-width: 44px;
min-height: 12px;
}
jsFiddle: https://jsfiddle.net/2kkuvqxc/
propably you need add the class
.talk{ background-color: //color that you need; }
because the talk class is affecting the ul