Two horizontal lines across a box [duplicate] - html

This question already has answers here:
Line before and after title over image [duplicate]
(2 answers)
Closed 7 years ago.
I am trying to draw two horizontal lines across a box:
http://codepen.io/anon/pen/gpZqOQ
I used a plugin to generate some code based on a design. However the end result is not optimized.
<h1 id="H1_1">
<span id="SPAN_2">Feedback</span>
</h1>
#H1_1 {
box-sizing: border-box;
clear: both;
color: rgb(64, 64, 64);
height: 45px;
position: relative;
text-align: center;
width: 1140px;
perspective-origin: 570px 22.5px;
transform-origin: 570px 22.5px;
border: 0px none rgb(64, 64, 64);
font: normal normal normal normal 15px/22.5px 'Source Sans Pro', sans-serif;
margin: 0px 0px 70px;
outline: rgb(64, 64, 64) none 0px;
}/*#H1_1*/
#H1_1:after {
box-sizing: border-box;
color: rgb(64, 64, 64);
display: block;
height: 1px;
left: 0px;
position: absolute;
text-align: center;
top: 22.5px;
width: 1140px;
align-self: stretch;
perspective-origin: 570px 0.5px;
transform-origin: 570px 0.5px;
content: '"' '"';
background: rgb(189, 195, 199) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(64, 64, 64);
font: normal normal normal normal 15px/22.5px 'Source Sans Pro', sans-serif;
outline: rgb(64, 64, 64) none 0px;
}/*#H1_1:after*/
#SPAN_2 {
box-sizing: border-box;
color: rgb(189, 195, 199);
display: inline-block;
height: 45px;
position: relative;
text-align: center;
text-transform: uppercase;
width: 108.890625px;
z-index: 10;
perspective-origin: 54.4375px 22.5px;
transform-origin: 54.4375px 22.5px;
background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box;
border: 3px solid rgb(189, 195, 199);
font: normal normal bold normal 15px/normal Montserrat, sans-serif;
outline: rgb(189, 195, 199) none 0px;
padding: 10px 20px;
transition: all 0.2s ease 0s;
}/*#SPAN_2*/
Is there any other simpler way to achieve this via CSS?

<hr style=" width : 100%;">
<span id="SPAN_2">Feedback</span>
Apply following CSS
hr{
display: inline-block;
margin: 25px 0;
position: absolute;
}
#SPAN_2 {
position: absolute;
z-index: 2;
display: inline-block;
border: 3px solid rgb(189, 195, 199);
outline: rgb(189, 195, 199) none 0px;
padding: 10px 20px;
margin: 0 0 0 50%;
}

Try this:
<div>
bla
</div>
in combination with:
div {
padding: 80px;
background-color: red;
border-top: 5px double black;
border-bottom: 3px dotted black;
}
See http://jsfiddle.net/4ghvvke3/ to get the idea.
Or do I misunderstand your question, and do you wish to have a line behind your main box object?
I that case I advise background-image of 1px width with x-repeat, probably less bytes than all the CSS code.

Demo
using :before and :after like you have it, i added a classname instead of random ids
<h1 class="feedback">
<span>Feedback</span>
</h1>
css
.feedback {
position: relative;
text-align: center;
}
.feedback span {
box-sizing: border-box;
color: rgb(189, 195, 199);
display: inline-block;
height: 45px;
position: relative;
text-align: center;
text-transform: uppercase;
width: auto;
z-index: 10;
perspective-origin: 54.4375px 22.5px;
transform-origin: 54.4375px 22.5px;
background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box;
border: 3px solid rgb(189, 195, 199);
font: normal normal bold normal 15px/normal Montserrat, sans-serif;
outline: rgb(189, 195, 199) none 0px;
padding: 10px 20px;
transition: all 0.2s ease 0s;
position: relative;
z-index: 1;
}
.feedback:before,
.feedback:after {
content: '';
display: inline-block;
border: 1px solid rgb(189, 195, 199);
width: 100%;
position: absolute;
z-index: 0;
left: 0;
}
.feedback:before {
top: 40%;
}
.feedback:after {
bottom: 40%;
}

I made a simple fiddle to demonstrate the simplest way of achieving this.
<div id="box">
<hr class="line1">
<hr class="line2">
</div>
And CSS:
#box {
width: 85%;
margin: 0 auto;
}
.line1 {
width: 100%;
}
.line2 {
width: 100%;
}
This uses the hr property to draw 2 lines horizontally, in this case taking up 100% width of the parent container.
Or something like this for thinner lines.

.container {
width: 100%;
margin-top:3em;
text-align:center;
}
.feedback_box {
color: rgb(189, 195, 199);
line-height:45px;
text-align: center;
text-transform: uppercase;
background: rgb(255, 255, 255);
border: 3px solid rgb(189, 195, 199);
font: normal normal bold normal 15px/normal Montserrat, sans-serif;
padding: 1em;
z-index:4;
position:relative;
}
.line1, .line2 {
border:0;
height:3px;
background:rgb(189, 195, 199);
}
.line1 {
margin-bottom:-20px;
}
.line2 {
margin-top:-20px;
}
<div class="container">
<hr class="line1">
<span class="feedback_box">Feedback</span>
<hr class="line2">
</div>

Related

How to place two elements next to each other

The issue I'm having is that the two elements mafia and vampire don't align correctly. I'm able to retain the properties of the mafia element so that it looks like a box, but I can't do the same thing for the vampire element.
code:
div#boxes {
clear: both;
float: right;
width: 400px;
margin: 0 10px 10px;
vertical-align: top;
display: inline;
background-color: #fff;
border: 1px solid black;
height: 75px;
/* overflow: hidden; */
}
span#mafia {
clear: both;
float: left;
width: 199px;
margin: 0 -1px -1px;
vertical-align: top;
display: inline-block;
border: 1px solid rgb(153, 170, 181);
text-align: center;
position: relative;
top: -0.5px;
}
span#vampire {
clear: both;
/* float: initial; */
width: 50%;
margin: 0 -1px -1px;
vertical-align: top;
display: contents;
border: 1px solid rgb(153, 170, 181);
/* text-align: center; */
position: relative;
top: -0.5px;
/* margin-bottom: inherit; */
bottom: 50px;
padding-top: 50px;
}
div.rititle {
/* position: relative; */
vertical-align: top;
border-bottom: 1px solid rgb(153, 170, 181) !important;
float: left;
width: 200px;
/* margin-bottom: initial !important; */
text-align: center;
clear: both;
margin-left: auto;
display: inline-block;
font-size: 17px;
}
Style Attribute {
background-color: rgb(39, 44, 48);
color: rgb(230, 230, 230);
border-color: rgb(153, 170, 181);
}
span#mafia {
clear: both;
float: left;
width: 199px;
margin: 0 -1px -1px;
vertical-align: top;
display: inline-block;
border: 1px solid rgb(153, 170, 181);
text-align: center;
position: relative;
top: -0.5px;
}
Style Attribute {
background-color: rgb(39, 44, 48);
color: rgb(230, 230, 230);
border-color: rgb(153, 170, 181);
}
Style Attribute {
background-color: rgb(39, 44, 48);
color: rgb(230, 230, 230);
border-color: rgb(153, 170, 181);
}
Style Attribute {
background-color: rgb(39, 44, 48);
color: rgb(230, 230, 230);
border-color: rgb(153, 170, 181);
}
#container {
left: 0px;
color: #000;
width: 1000px;
min-width: 499px;
margin: 10px auto;
position: relative;
background-color: #FFF;
box-shadow: -2px 2px 5px #111;
}
Style Attribute {
background-color: rgb(39, 44, 48);
color: rgb(230, 230, 230);
border-color: rgb(153, 170, 181);
}
body {
color: #FFF;
background-color: #999;
font-family: Arial, sans-serif;
/* margin-bottom: 40px; */
}
.rititle {
margin-left: 10px;
font-weight: bold;
vertical-align: top;
}
* {
margin: 0px;
padding: 0px;
}
div {
display: block;
}
div#switch {
clear: both !important;
width: 200px !important;
margin: 0 0px 0px !important;
vertical-align: middle !important;
display: block !important;
text-align: center !important;
position: relative !important;
border: 1px solid rgb(153, 170, 181);
/*top: -76px;*/
float: right;
text-align: center !important;
border-bottom: 1px solid rgb(153, 170, 181) !important;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="boxes" style="background-color: rgb(39, 44, 48);color: rgb(230, 230, 230);border-color: rgb(153, 170, 181);"><span id="mafia" style="background-color: rgb(39, 44, 48); color: rgb(230, 230, 230); border-color: rgb(153, 170, 181);"><div class="rititle">Mafia</div><div style="font-size: 12px"><span class="rititle">Mafioso: </span>2. Cotton Mather</div>
<div style="font-size: 12px"><span class="rititle">Consort: </span>4. Edward Bishop</div>
<div style="font-size: 12px"><span class="rititle">Godfather: </span>7. Black Stain</div>
<div style="font-size: 12px"><span class="rititle">Consigliere: </span>10. bonr juice</div>
</span><span id="vampire" style="background-color: rgb(39, 44, 48); color: rgb(230, 230, 230); border-color: rgb(153, 170, 181);"><div id="switch" class="rititle">Coven</div><div style="font-size: 12px"><span class="rititle">Coven Leader: </span>1. Oppai Dragon</div>
<div
style="font-size: 12px"><span class="rititle">Medusa: </span>3. Jades Whoree</div>
<div style="font-size: 12px"><span class="rititle">Potion Master: </span>11. RainBow</div>
<div style="font-size: 12px"><span class="rititle">Necromancer: </span>13. DevilEvilSatan</div>
<div style="font-size: 12px"><span class="rititle">Necromancer: </span>13. DevilEvilSatan</div>
</span>
<div style="font-size: 12px"><span class="rititle">Necromancer: </span>13. DevilEvilSatan</div>
</div>
</body>
</html>
I am trying to align the two span elements called mafia and vampire along with their children elements like columns. Also, would it be possible to make it so that the height of the element boxes changes to fit the length of the longest column?
As simple as below using css flexbox;
Your code is sooo dirty, mostly redundant, false use of classes and styles.
.columns{
display: flex;
}
.columns .box{
flex: 1;
background: #000;
color: #fff;
border: 1px solid #f5f5f5;
text-align: center;
display: flex;
flex-direction: column;
}
.box .title{
font-weight: bold;
font-size: 15px;
padding: 5px;
border: 1px solid #f5f5f5;
}
<div class='columns'>
<div class='box'>
<span class='title'>Mafia</span>
</div>
<div class='box'>
<span class='title'>Coven</span>
<span>sssssss</span>
<span>sssssss</span>
<span>sssssss</span>
</div>
</div>

CSS: Styling range input?

I'm trying to style a range input to look like THIS
I have no idea how to style a range input to use own image as the thumb and make the line under the thumb thicker and bigger.
I did put a very basic example in this FIDDLE
Is it even possible to use own image for the range thumb and how would i go about making the line thicker and longer etc?
This is my CSS:
input[type=range] {
-webkit-appearance: none;
background-color: blue;
width: 200px;
height:20px;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
background-color: #666;
opacity: 0.5;
width: 10px;
height: 26px;
background-image:url('THUMB-ICON.png');
}
Any advise would be appreciated.
Getting somewhere I think: https://jsfiddle.net/BNm8j/5586/
Edit:
I made some changes to this but I don't know why the top of the thumb is missing?
https://jsfiddle.net/BNm8j/5588/
any ideas anyone?
here is the original CSS of the example link:
<div id="DIV_1">
<div id="DIV_2">
</div><a id="A_3"></a>
</div>
hope this helps you.
enter code here
#DIV_1 {
box-sizing: border-box;
color: rgb(92, 92, 92);
float: left;
height: 11px;
overflow-wrap: break-word;
position: relative;
touch-action: none;
width: 705px;
word-wrap: break-word;
column-rule-color: rgb(92, 92, 92);
perspective-origin: 352.5px 5.5px;
transform-origin: 352.5px 5.5px;
background: rgb(222, 222, 222) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(92, 92, 92);
border-radius: 3px 3px 3px 3px;
font: normal normal normal normal 16px / normal Omnes, sans-serif;
margin: 11px 30px 0px;
outline: rgb(92, 92, 92) none 0px;
}/*#DIV_1*/
#DIV_2 {
box-sizing: border-box;
color: rgb(92, 92, 92);
height: 11px;
overflow-wrap: break-word;
position: absolute;
top: 0px;
width: 122px;
word-wrap: break-word;
column-rule-color: rgb(92, 92, 92);
perspective-origin: 61px 5.5px;
transform-origin: 61px 5.5px;
background: rgb(0, 143, 213) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(92, 92, 92);
border-radius: 3px 3px 3px 3px;
font: normal normal normal normal 16px / normal Omnes, sans-serif;
outline: rgb(92, 92, 92) none 0px;
}/*#DIV_2*/
#A_3 {
background-position: -65px 0px;
box-sizing: border-box;
color: rgb(247, 144, 47);
cursor: default;
display: block;
height: 59px;
left: 155px;
overflow-wrap: break-word;
position: absolute;
text-decoration: none;
top: -22px;
touch-action: none;
width: 58px;
word-wrap: break-word;
z-index: 100;
column-rule-color: rgb(247, 144, 47);
perspective-origin: 29px 29.5px;
transform-origin: 29px 29.5px;
background: rgba(0, 0, 0, 0) url("https://www.wonga.com/sites/all/themes/pizaz/images/mint/toolkit.png?v=2.2") no-repeat scroll -65px 0px / auto padding-box border-box;
border: 0px none rgb(247, 144, 47);
font: normal normal normal normal 16px / normal Omnes, sans-serif;
margin: 0px 0px 0px -62px;
outline: rgb(247, 144, 47) none 0px;
}/*#A_3*/
Here is a (hopefully) very ease to use tool to customize the style of <input> range:
https://toughengineer.github.io/demo/slider-styler
Here is an example:
for (let e of document.querySelectorAll('input[type="range"].slider-progress')) {
e.style.setProperty('--value', e.value);
e.style.setProperty('--min', e.min == '' ? '0' : e.min);
e.style.setProperty('--max', e.max == '' ? '100' : e.max);
e.addEventListener('input', () => e.style.setProperty('--value', e.value));
}
/*generated with Input range slider CSS style generator (version 20201223)
https://toughengineer.github.io/demo/slider-styler*/
input[type=range].styled-slider {
height: 2.2em;
-webkit-appearance: none;
}
/*progress support*/
input[type=range].styled-slider.slider-progress {
--range: calc(var(--max) - var(--min));
--ratio: calc((var(--value) - var(--min)) / var(--range));
--sx: calc(0.5 * 2em + var(--ratio) * (100% - 2em));
}
input[type=range].styled-slider:focus {
outline: none;
}
/*webkit*/
input[type=range].styled-slider::-webkit-slider-thumb {
width: 2em;
height: 2em;
border-radius: 1em;
background: #007cf8;
border: none;
box-shadow: 0 0 2px black;
margin-top: calc(max((1em - 1px - 1px) * 0.5,0px) - 2em * 0.5);
-webkit-appearance: none;
}
input[type=range].styled-slider::-webkit-slider-runnable-track {
height: 1em;
border-radius: 0.5em;
background: #efefef;
border: 1px solid #b2b2b2;
box-shadow: none;
}
input[type=range].styled-slider::-webkit-slider-thumb:hover {
background: #0061c3;
}
input[type=range].styled-slider:hover::-webkit-slider-runnable-track {
background: #e5e5e5;
border-color: #9a9a9a;
}
input[type=range].styled-slider::-webkit-slider-thumb:active {
background: #2f98f9;
}
input[type=range].styled-slider:active::-webkit-slider-runnable-track {
background: #f5f5f5;
border-color: #c1c1c1;
}
input[type=range].styled-slider.slider-progress::-webkit-slider-runnable-track {
background: linear-gradient(#007cf8,#007cf8) 0/var(--sx) 100% no-repeat, #efefef;
}
input[type=range].styled-slider.slider-progress:hover::-webkit-slider-runnable-track {
background: linear-gradient(#0061c3,#0061c3) 0/var(--sx) 100% no-repeat, #e5e5e5;
}
input[type=range].styled-slider.slider-progress:active::-webkit-slider-runnable-track {
background: linear-gradient(#2f98f9,#2f98f9) 0/var(--sx) 100% no-repeat, #f5f5f5;
}
/*mozilla*/
input[type=range].styled-slider::-moz-range-thumb {
width: 2em;
height: 2em;
border-radius: 1em;
background: #007cf8;
border: none;
box-shadow: 0 0 2px black;
}
input[type=range].styled-slider::-moz-range-track {
height: max(calc(1em - 1px - 1px),0px);
border-radius: 0.5em;
background: #efefef;
border: 1px solid #b2b2b2;
box-shadow: none;
}
input[type=range].styled-slider::-moz-range-thumb:hover {
background: #0061c3;
}
input[type=range].styled-slider:hover::-moz-range-track {
background: #e5e5e5;
border-color: #9a9a9a;
}
input[type=range].styled-slider::-moz-range-thumb:active {
background: #2f98f9;
}
input[type=range].styled-slider:active::-moz-range-track {
background: #f5f5f5;
border-color: #c1c1c1;
}
input[type=range].styled-slider.slider-progress::-moz-range-track {
background: linear-gradient(#007cf8,#007cf8) 0/var(--sx) 100% no-repeat, #efefef;
}
input[type=range].styled-slider.slider-progress:hover::-moz-range-track {
background: linear-gradient(#0061c3,#0061c3) 0/var(--sx) 100% no-repeat, #e5e5e5;
}
input[type=range].styled-slider.slider-progress:active::-moz-range-track {
background: linear-gradient(#2f98f9,#2f98f9) 0/var(--sx) 100% no-repeat, #f5f5f5;
}
/*ms*/
input[type=range].styled-slider::-ms-fill-upper {
background: transparent;
border-color: transparent;
}
input[type=range].styled-slider::-ms-fill-lower {
background: transparent;
border-color: transparent;
}
input[type=range].styled-slider::-ms-thumb {
width: 2em;
height: 2em;
border-radius: 1em;
background: #007cf8;
border: none;
box-shadow: 0 0 2px black;
margin-top: 0;
box-sizing: border-box;
}
input[type=range].styled-slider::-ms-track {
height: 1em;
border-radius: 0.5em;
background: #efefef;
border: 1px solid #b2b2b2;
box-shadow: none;
box-sizing: border-box;
}
input[type=range].styled-slider::-ms-thumb:hover {
background: #0061c3;
}
input[type=range].styled-slider:hover::-ms-track {
background: #e5e5e5;
border-color: #9a9a9a;
}
input[type=range].styled-slider::-ms-thumb:active {
background: #2f98f9;
}
input[type=range].styled-slider:active::-ms-track {
background: #f5f5f5;
border-color: #c1c1c1;
}
input[type=range].styled-slider.slider-progress::-ms-fill-lower {
height: max(calc(1em - 1px - 1px),0px);
border-radius: 0.5em 0 0 0.5em;
margin: -1px 0 -1px -1px;
background: #007cf8;
border: 1px solid #b2b2b2;
border-right-width: 0;
}
input[type=range].styled-slider.slider-progress:hover::-ms-fill-lower {
background: #0061c3;
border-color: #9a9a9a;
}
input[type=range].styled-slider.slider-progress:active::-ms-fill-lower {
background: #2f98f9;
border-color: #c1c1c1;
}
ordinary slider:<br />
<input type="range" class="styled-slider" style="width: 20em;" /><br />
slider with progress styling (made it slightly longer):<br />
<input type="range" class="styled-slider slider-progress" style="width: 30em;" />

How to properly overlap text over an image

I'm having a bit of trouble having my text display only within my image. It's dependent on the length of the text, if it's two rows long, then it'll display correct. Any longer it'll extend past the image. I can fix this by setting the bottom: 25px; for my featured_wrapper but I don't think that's a Good fix. If the text is only 2 rows long then that it sets the text higher than it should. May I ask how should I properly set the text so that it'll always remain within the image.
<div id="featured_item">
<a href="http://bandwagonbible.com/Fitness/GettingSixPackAbs" id="featured_link">
<picture id="featured_picture">
<img src="http://bandwagonbible.com/Stories/Fitness/GettingSixPackAbs/Image2.jpg" id="featured_image" alt='' />
</picture>
<div id="featured_wrapper">
<h3 id="featured_title">
A Beginners Guide To Getting Six Pack Abs ... add in some more text
</h3>
</div>
</a>
</div>
http://codepen.io/anon/pen/eZVdpq
Change the height to auto in your #featured_wrapper rule
#featured_wrapper {
bottom: -2px;
box-sizing: border-box;
color: rgb(40, 173, 230);
height: auto; /* <--- changed to auto */
#featured_item {
box-sizing: border-box;
color: rgb(34, 34, 34);
height: 173.813px;
min-height: auto;
min-width: auto;
overflow-wrap: break-word;
position: relative;
width: 309.297px;
word-wrap: break-word;
perspective-origin: 154.641px 86.9063px;
transform-origin: 154.641px 86.9063px;
border: 0px none rgb(34, 34, 34);
font: normal normal normal normal 16px / 24px ProximaNovaCond, sans-serif;
margin: 0px 21px 0px 0px;
outline: rgb(34, 34, 34) none 0px;
}
#featured_link {
box-sizing: border-box;
color: rgb(40, 173, 230);
display: block;
height: 173.813px;
overflow-wrap: break-word;
text-decoration: none;
width: 309.297px;
word-wrap: break-word;
perspective-origin: 154.641px 86.9063px;
transform-origin: 154.641px 86.9063px;
background: rgb(245, 245, 245) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(40, 173, 230);
font: normal normal normal normal 16px / 24px ProximaNovaCond, sans-serif;
outline: rgb(40, 173, 230) none 0px;
padding: 0px 0px 173.813px;
}
#featured_picture {
box-sizing: border-box;
color: rgb(40, 173, 230);
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
word-wrap: break-word;
border: 0px none rgb(40, 173, 230);
font: normal normal normal normal 16px / 24px ProximaNovaCond, sans-serif;
outline: rgb(40, 173, 230) none 0px;
}
#featured_image {
box-sizing: border-box;
color: rgb(40, 173, 230);
display: inline-block;
height: 173.969px;
max-width: 100%;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
vertical-align: middle;
width: 309.297px;
word-wrap: break-word;
perspective-origin: 154.641px 86.9844px;
transform-origin: 154.641px 86.9844px;
background: rgb(245, 245, 245) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(40, 173, 230);
font: normal normal normal normal 16px / 24px ProximaNovaCond, sans-serif;
outline: rgb(40, 173, 230) none 0px;
overflow: hidden;
}
#featured_wrapper {
bottom: -2px;
box-sizing: border-box;
color: rgb(40, 173, 230);
height: auto;
left: 0px;
overflow-wrap: break-word;
position: absolute;
right: 20px;
width: 289.297px;
word-wrap: break-word;
perspective-origin: 144.641px 45px;
transform-origin: 104.641px 45px;
border: 0px none rgb(40, 173, 230);
font: normal normal normal normal 16px / 24px ProximaNovaCond, sans-serif;
outline: rgb(40, 173, 230) none 0px;
}
#featured_title {
box-sizing: border-box;
color: rgb(255, 255, 255);
display: inline;
height: auto;
overflow-wrap: break-word;
position: relative;
text-rendering: optimizeLegibility;
width: auto;
word-wrap: break-word;
background: rgba(0, 0, 0, 0.701961) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(255, 255, 255);
font: normal normal normal normal 22px / 22px ProximaNovaCond, sans-serif;
margin: 0px 0px 0px;
outline: rgb(255, 255, 255) none 0px;
padding: 0px 10px;
transition: all 0.1s ease-in-out 0s;
}
<div id="featured_item">
<a href="http://bandwagonbible.com/Fitness/GettingSixPackAbs" id="featured_link">
<picture id="featured_picture">
<img src="http://bandwagonbible.com/Stories/Fitness/GettingSixPackAbs/Image2.jpg" id="featured_image" alt='' />
</picture>
<div id="featured_wrapper">
<h3 id="featured_title">
A Beginners Guide To Getting Six Pack Abs ... add in some more text
</h3>
</div>
</a>
</div>
And I don't think you need all that CSS/markup either, so here is a shortened version for you.
#featured_item {
position: relative;
width: 309.297px;
margin: 0px 21px 0px 0px;
}
#featured_link {
display: block;
position: relative;
text-decoration: none;
}
#featured_image {
max-width: 100%;
}
#featured_title {
color: rgb(255, 255, 255);
height: auto;
position: absolute;
left: 0;
right: 0;
bottom: 0;
text-rendering: optimizeLegibility;
background: rgba(0, 0, 0, 0.701961);
font: normal 22px / 22px ProximaNovaCond, sans-serif;
padding: 0px 10px;
transition: all 0.1s ease-in-out 0s;
}
<div id="featured_item">
<a href="http://bandwagonbible.com/Fitness/GettingSixPackAbs" id="featured_link">
<img src="http://bandwagonbible.com/Stories/Fitness/GettingSixPackAbs/Image2.jpg" id="featured_image" alt='' />
<div id="featured_title">
A Beginners Guide To Getting Six Pack Abs ... add in some more text
</div>
</a>
</div>
Remove the height: 50px; in the #featured_wrapper rule and also change the bottom:2px; to 0 to make it be stick to the bottom.
Like this
I also change the display:inline of the text and add a width:100% to make the text adapt the full width of the image.

How to fit content inside div

I'm having trouble fitting any amount of content inside the entire block div, I've tried to set the height to auto however that didn't work, I've tried the overflow property which didn't work as well. I would like the entire div height to expand when there is more content because I'm dynamically changing the content, I'm not understanding why the entire div height is not expanding as there is more content inside it. Below is the example.
Please provide thorough explanation to why the div height is not expanding.
#entire-block {
bottom: 50px;
box-shadow: rgb(159, 159, 155) 4px 4px 4px -1px;
box-sizing: border-box;
/* min-height: 136px; */
height: auto;
position: fixed;
overflow: ;
right: 0px;
width: 370px;
z-index: 999;
background: rgb(215, 215, 210) none repeat scroll 0% 0% / auto padding-box border-box;
font: normal normal normal 16px/16px'Times New Roman';
padding: 10px 10px 13px;
}
/*#DIV_1*/
#A_2 {
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: pointer;
display: none;
left: 5px;
position: fixed;
text-decoration: none solid rgb(255, 255, 255);
top: 43px;
z-index: 999;
border: 0px none rgb(255, 255, 255);
font: normal normal normal 25px/25px'Source Sans Pro ExtraLight';
outline: rgb(255, 255, 255) none 0px;
}
/*#A_2*/
#x {
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: pointer;
display: block;
float: right;
height: 44px;
text-decoration: none solid rgb(255, 255, 255);
width: 21px;
border: 0px none rgb(255, 255, 255);
font: normal normal normal 44px/44px'Source Sans Pro ExtraLight';
margin: -11px 0px 0px;
outline: rgb(255, 255, 255) none 0px;
}
/*#A_3*/
#entire-content-section {
box-sizing: border-box;
height: 113px;
width: 350px;
font: normal normal normal 16px/16px'Times New Roman';
}
/*#DIV_4*/
#IMG_5 {
box-sizing: border-box;
display: block;
float: left;
height: auto;
width: 40px;
font: normal normal normal 16px/16px'Times New Roman';
margin: 0px 10px 0px 0px;
}
/*#IMG_5*/
#top-content-section {
box-sizing: border-box;
height: 90px;
width: 350px;
font: normal normal normal 16px/16px'Times New Roman';
}
/*#DIV_6*/
#content-header {
box-sizing: border-box;
height: 56px;
width: 350px;
font: normal normal normal 28px/28px league_gothicregular;
margin: 0px;
padding-top: 1%;
}
/*#H3_7*/
#middle-content {
box-sizing: border-box;
font: normal normal normal 16px/16px'Source Sans Pro';
}
/*#SPAN_8*/
#content-bottom {
box-sizing: border-box;
color: rgb(0, 173, 237);
cursor: pointer;
display: block;
height: 12px;
letter-spacing: 1.6799999475479126px;
text-decoration: none solid rgb(0, 173, 237);
text-transform: uppercase;
width: 350px;
border: 0px none rgb(0, 173, 237);
font: normal normal normal 12px/12px'Source Sans Pro Black';
margin: 11px 0px 0px;
outline: rgb(0, 173, 237) none 0px;
}
/*#A_11*/
<div id="entire-block">
<a id="x">×</a>
<div id="entire-content-section">
<img src="http://www.ratemyprofessors.com/assets/average-icon-b4b6eb5e309d26486d76ecebe920220f.jpg?1455038037" id="IMG_5" alt='' />
<div id="top-content-section">
<h3 id="content-header">
Average
</h3> <span id="middle-content">Attending class is not necessary, but reading the textbook is a must. I attended all of his classes for ECON1000 but didn't find it helpful, so I never went to class for ECON1010. Do your readings and study from the test banks. With some effort, you're guaranteed to get an A. Would take his class again.</span>
</div>
Find out what students are saying.
</div>
</div>
You have fixed the height that's why it is showing of fixed height. Remove height from #entire-content-section and #top-content-section.

css triangle at the end of <li>

I want to achieve something like this
How do I put this triangle css
.triangle{
width: 0;
height: 0;
border-style: solid;
border-width: 21px 42px 21px 0;
border-color: transparent #eeeeee transparent transparent;
line-height: 0px;
_border-color: #000000 #eeeeee #000000 #000000;
_filter: progid:DXImageTransform.Microsoft.Chroma(color='#000000');
}
to make a triangle at the end of my tab? DEMO http://jsfiddle.net/p69qfqsx/
New CSS for the list:
ul{
width: 200px;
border: 1px solid #ccc;
}
li a{
background-color: #fff;
padding: 5px 10px;
display: block;
position: relative;
color: #666;
text-decoration: none;
}
li a:hover, li.active a{
background-color: #eee;
}
li a:hover:after, li.active a:after{
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #fff;
/* background-color: #ddd; */
content: '';
position: absolute;
right: -2px;
top: 0;
}
https://jsfiddle.net/p69qfqsx/2/
Tested just for chrome hope it helps.
Here's the codes I modify for little change:
li a:hover:after{
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 12px solid transparent;
border-right: 10px solid #fff;
/* background-color: #ddd; */
content: '';
position: absolute;
right: -2px;
top: 1;
}
I just remove li.active a:after to let pointer makes it. DEMO
But I prefer using what #Andre Morales suggest since it works here.
It's pretty easy. You can do it in many methods, I can suggest an easy trick. Add an span inside the li tag. check this out : jsFiddle
HTML
<li id="LI_3">
Platform
<span class="trian"></span>
</li>
CSS
.trian {
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-right: 25px solid #fff;
position:absolute;
right:0;
top:0;
}
Add this to your css where .active is the class of the current list
[id^=UL_] > [id^=LI_].active:before{
position: absolute;
top: 0;
right: -1px; /* -1px to hide the right border */
content:'';
z-index: 1;
border-top: 20px solid transparent; /*20 = li.height /2 */
border-bottom: 20px solid transparent;
border-right: 20px solid white
}
DEMO
#DIV_1 {
box-sizing: border-box;
color: rgb(51, 51, 51);
float: left;
height: 264px;
min-height: 1px;
position: relative;
width: 169px;
perspective-origin: 84.5px 132px;
transform-origin: 84.5px 132px;
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
margin: 0px 0px 0px -15px;
outline: rgb(51, 51, 51) none 0px;
padding: 0px 15px;
}/*#DIV_1*/
#UL_2 {
box-sizing: border-box;
color: rgb(51, 51, 51);
height: 264px;
width: 139px;
perspective-origin: 69.5px 132px;
transform-origin: 69.5px 132px;
border-top: 0px none rgb(51, 51, 51);
border-right: 1px solid rgb(238, 238, 238);
border-bottom: 0px none rgb(51, 51, 51);
border-left: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
margin: 0px;
outline: rgb(51, 51, 51) none 0px;
padding: 0px;
}/*#UL_2*/
#UL_2:after {
box-sizing: border-box;
clear: both;
color: rgb(51, 51, 51);
display: table;
width: 1px;
perspective-origin: 0.5px 0px;
transform-origin: 0.5px 0px;
content: ' ';
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(51, 51, 51) none 0px;
}/*#UL_2:after*/
#UL_2:before {
box-sizing: border-box;
color: rgb(51, 51, 51);
display: table;
width: 1px;
perspective-origin: 0.5px 0px;
transform-origin: 0.5px 0px;
content: ' ';
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(51, 51, 51) none 0px;
}/*#UL_2:before*/
#LI_3 {
box-sizing: border-box;
color: rgb(51, 51, 51);
display: block;
height: 40px;
position: relative;
width: 139px;
perspective-origin: 69.5px 20px;
transform-origin: 69.5px 20px;
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
margin: 0px -1px -1px 0px;
outline: rgb(51, 51, 51) none 0px;
}/*#LI_3*/
#A_4 {
box-sizing: border-box;
color: rgb(85, 85, 85);
cursor: default;
display: block;
height: 40px;
position: relative;
text-align: left;
text-decoration: none;
width: 139px;
perspective-origin: 69.5px 20px;
transform-origin: 69.5px 20px;
background: rgb(238, 238, 238) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(85, 85, 85);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(85, 85, 85) none 0px;
padding: 10px 15px;
}/*#A_4*/
#LI_5, #LI_7, #LI_9, #LI_13 {
box-sizing: border-box;
color: rgb(51, 51, 51);
display: block;
height: 42px;
position: relative;
width: 139px;
perspective-origin: 69.5px 21px;
transform-origin: 69.5px 21px;
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
margin: 0px -1px -1px 0px;
outline: rgb(51, 51, 51) none 0px;
}/*#LI_5, #LI_7, #LI_9, #LI_13*/
#A_6, #A_8, #A_14 {
box-sizing: border-box;
color: rgb(51, 122, 183);
display: block;
height: 42px;
position: relative;
text-align: left;
text-decoration: none;
width: 139px;
perspective-origin: 69.5px 21px;
transform-origin: 69.5px 21px;
border: 1px solid rgba(0, 0, 0, 0);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(51, 122, 183) none 0px;
padding: 10px 15px;
}/*#A_6, #A_8, #A_14*/
#A_10 {
box-sizing: border-box;
color: rgb(51, 122, 183);
display: block;
height: 42px;
position: relative;
text-align: left;
text-decoration: none;
width: 139px;
perspective-origin: 69.5px 21px;
transform-origin: 69.5px 21px;
border: 1px solid rgba(0, 0, 0, 0);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(51, 122, 183) none 0px;
padding: 10px 15px;
}/*#A_10*/
#LI_11 {
box-sizing: border-box;
color: rgb(51, 51, 51);
display: block;
height: 62px;
position: relative;
width: 139px;
perspective-origin: 69.5px 31px;
transform-origin: 69.5px 31px;
border: 0px none rgb(51, 51, 51);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
margin: 0px -1px -1px 0px;
outline: rgb(51, 51, 51) none 0px;
}/*#LI_11*/
#A_12 {
box-sizing: border-box;
color: rgb(51, 122, 183);
display: block;
height: 62px;
position: relative;
text-align: left;
text-decoration: none;
width: 139px;
perspective-origin: 69.5px 31px;
transform-origin: 69.5px 31px;
border: 1px solid rgba(0, 0, 0, 0);
font: normal normal normal normal 14px/20px 'Open Sans', sans-serif;
list-style: none outside none;
outline: rgb(51, 122, 183) none 0px;
padding: 10px 15px;
}/*#A_12*/
[id=UL_2] > [id=LI_3]:before{
position: absolute;
top: 0;
right: -1px;
content:'';
z-index: 1;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-right: 20px solid white
}
<div id="DIV_1">
<!-- required for floating -->
<!-- Nav tabs -->
<ul id="UL_2">
<li id="LI_3">
Platform
</li>
<li id="LI_5">
Content
</li>
<li id="LI_7">
Marketing
</li>
<li id="LI_9">
Social
</li>
<li id="LI_11">
In-app Responses
</li>
<li id="LI_13">
Systems
</li>
</ul>
</div>
I think this is a cleaner method using clip-path:
ul{
width: 160px;
border: 1px solid #ccc;
border-right: none;
list-style-type: none;
margin:0;
padding:0;
}
li a{
padding: 5px 10px;
display: block;
color: #666;
text-decoration: none;
border-right:1px solid #ccc;
}
li a:hover, li.active a{
background-color: #eee;
clip-path: polygon( 0% 0%,0% 100%,100% 100%,92% 50%,100% 0%);
}
<ul>
<li class="active">
Platform
</li>
<li>
Content
</li>
<li>
Marketing
</li>
<li>
Social
</li>
<li>
In-app Responses
</li>
<li>
Systems
</li>
</ul>