Bottom border overlay content of fieldset - html

I want to accomplish a certain effect in which the bottom border of the fieldset should overlay the content inside it, with a z-index lower than the content so it could look like this:
What I got so far was the simple thing, in which each circle in contained inside the fieldset, but no effect whats so ever.
The HTML and CSS code follows. Any lead on how to accomplish it is wellcome, I researched but didn't find any documentation of the fieldset tag that helped.
fieldset {
margin-left: 80px;
margin-right: 80px;
padding-bottom: 50px;
padding-bottom: 20px;
border: 5px dotted rgb(88, 85, 86);
}
label {
float: left;
width: 25%;
margin-right: 0.5em;
padding-top: 0.2em;
text-align: right;
font-weight: bold;
}
legend {
padding: 0.2em 0.5em;
max-width: 475px;
color: rgb(88, 85, 86);
text-align: center;
font-family: 'gotham-book';
font-size: 32px;
}
<form>
<fieldset>
<legend>Veja como é fácil participar</legend>
<div class="col-lg-2 col-md-6 col-sm-6 col-xs-12" style="margin-left: 9%">
<div class="circles circle-yellow">
<img class="img-responsive" src="\galeria\repositorio\images\landing\mensalidades-iguais\money.png">
<p class="yellow-texto">
Mensalidades que cabem no seu bolso
</p>
</div>
</div>
<div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
<div class="circles circle-yellow">
<h1 class="yellow-parcelas">12x</h1>
<p class="yellow-texto">
parcelas iguais
</p>
</div>
</div>
<div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
<div class="circles circle-red">
<span class="red-span">R$</span>
<h1 class="red-parcelas">162</h1>
<p class="red-texto">
mensais
</p>
<small class="red-small">R$ 1.944,00 ANUAL</small>
</div>
</div>
<div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
<div class="circles circle-light-blue">
<span class="light-blue-span">R$</span>
<h1 class="light-blue-parcelas">37</h1>
<p class="light-blue-texto">
mensais
</p>
<p class="light-blue-texto">
material
</p>
<p class="light-blue-texto">
didático
</p>
<small class="light-blue-small">R$ 444,00 ANUAL</small>
</div>
</div>
<div class="col-lg-2 col-md-6 col-sm-6 col-xs-12">
<div class="circles circle-dark-blue">
<div class="dark-blue-texto">total</div>
<span class="dark-blue-span">R$</span>
<h1 class="dark-blue-parcelas">162</h1>
<p class="dark-blue-texto">
mensais
</p>
<small class="dark-blue-small">R$ 1.944,00 ANUAL</small>
</div>
</div>
</fieldset>
</form>

The trick is to use absolute positioning to take advantage of the z-index, as shown in my JS Fiddle. I won't bore you with the details you can read more about it here > Link. I'll leave my code below, any further questions feel free to ask.
* {
margin: 0;
padding: 0;
}
.wrap {
position: relative;
width: 90%;
margin: 0 auto;
margin-top: 1em;
background: #ccc;
height: 200px;
border: 2px dotted #f0f;
}
.inner {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
margin: 0 auto;
width: 80%;
height: 200px;
background: #f0f;
margin-top: 100px;
}
<div class="wrap">
<div class="inner">
<!-- Your Icons here. -->
</div>
</div>
NOTE:
If this answer met your needs don't forget to mark it as correct for other users to find when surfing the web. Thanks.
Regards,
-B

Related

Creating square responsive box with 4 elements per row

MARKUP::
<div class="alumni">
<div class="alumni-list col-xs-3">
<div class="innerBg" ng-style="{'background':'url('../dummyimage.png')'}">
</div>
</div>
<div class="alumni-list col-xs-3">
<div class="innerBg" ng-style="{'background':'url('../dummyimage.png')'}">
</div>
</div>
<div class="alumni-list col-xs-3">
<div class="innerBg" ng-style="{'background':'url('../dummyimage.png')'}">
</div>
</div>
<div class="alumni-list col-xs-3">
<div class="innerBg" ng-style="{'background':'url('../dummyimage.png')'}">
</div>
</div>
</div>
CSS::
.alumni {
max-height: 280px;
padding: 10px;
overflow: auto;
}
.alumni-list {
text-align: center;
margin-bottom: 10px;
padding: 0px 5px;
}
.innerBg {
height: 56px;
max-width: 56px;
background-size: cover;
border-radius: 4px;
background-position: center center !important;
}
alumni container contains 4 alumni-list. Irrespective of screen size, all alumni-list should come in square shape. This is what I tried so far and I'm using bootstrap 3.

How to move in bootstrap a element whitin of a column?

I'm try to do a footer with bootstrap and I need move a span element, this one is whitin of a column set up it with col-sm-4 class, How do I can move this one for instance 20px whitout affecting responsive design. Below I put a image about footer and the html structure and css. I appreciate any help.
<footer class="footer">
<div class="container-fluid">
<div class="row">
<div id="location" class="col-sm-4 col-xs-3">
<span>Location</span>
</div>
<div id="info" class="col-sm-4 col-xs-3">
<span>Info about me</span>
</div>
<div id="created" class="col-sm-4 col-xs-3">
<p>texto</p>
</div>
</div>
</div>
</footer>
css:
.footer{
position: fixed;
bottom:0%;
height: 100px;
width: 100%;
background-color: #2c3e50;
}
#location{
background-color: white;
height: 50px;
}
#info{
background-color: gray;
height: 50px;
}
#created{
background-color: blue;
height: 50px;
}
You can use <span style="padding-left:20px;">move space 20px</span>
It will not affect responsiveness

div not resizing with content

Sorry if this is a duplicate question, but I couldn't find an exact match to this which worked, so here it goes.
I have a web page with divs for each database entry. However, the div doesn't resize with text, causing the text to display out of div. I'm using bootstrap.
I've attached a fiddle.
Increase the width of the fiddle output to see the overflowing text.
Currently, i'm working on just the desktop version, but i'll have to build a mobile version as well. So it'll be better if you can help me out with both :)
Below is my code
.each-entry-box {
min-height: 80px;
max-height: 110px;
width: 80%;
background: #F5F5F5;
margin: 10px;
border-radius: 5px;
position: relative;
}
.each-entry-box-header {
height: auto;
width: 100%;
background: #E6E6FA;
margin: 0;
border-radius: 5px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
position: absolute;
padding: 2px;
}
.main-content {
margin: 15px;
top: 30px;
position: relative;
width: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="each-entry-box">
<div class="each-entry-box-header">
<div class="col-md-9 customer-name">
<i class="glyphicon glyphicon-user glyphicon-class"></i><span>customer name</span>
</div>
<div class="col-md-3 added-on">
<i class="glyphicon glyphicon-time glyphicon-class"></i><span>time</span>
</div>
</div> <!-- each-entry-box-header ends here -->
<div class="main-content">
<div class="col-md-12">
<div class="col-md-3 customer-mobile">
<i class="glyphicon glyphicon-earphone glyphicon-class"></i><span>mobile number</span>
</div>
<div class="col-md-9 customer-email">
<i class="glyphicon glyphicon-envelope glyphicon-class"></i><span>No email ID added</span>
</div>
</div>
<div class="col-md-12">
Material : None
</div>
<div class="col-md-12">
<div class="col-md-4">
XYZ : None
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
Here's a working JS Fiddle,
I've floated both divs and removed the absolute positioning, I've also changed the background colour from the parent element to the child element, so as the list grows, the background will too
HTML:
<div class="each-entry-box">
<div class="each-entry-box-header">
<div class="col-md-9 customer-name">
<i class="glyphicon glyphicon-user glyphicon-class"></i><span>customer name</span>
</div>
<div class="col-md-3 added-on">
<i class="glyphicon glyphicon-time glyphicon-class"></i><span>time</span>
</div>
</div> <!-- each-entry-box-header ends here -->
<div class="main-content">
<div class="col-md-12">
<div class="col-md-3 customer-mobile">
<i class="glyphicon glyphicon-earphone glyphicon-class"></i><span>mobile number</span>
</div>
<div class="col-md-9 customer-email">
<i class="glyphicon glyphicon-envelope glyphicon-class"></i><span>No email ID added</span>
</div>
</div>
<div class="col-md-12">
Material : None
</div>
<div class="col-md-12">
<div class="col-md-4">
XYZ : None
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>
CSS:
.each-entry-box{
min-height: 80px;
max-height: 110px;
width: 80%;
background: #F5F5F5;
margin: 10px;
border-radius: 5px;
position: relative;
}
.each-entry-box-header{
height: auto;
width: 100%;
background: #E6E6FA;
margin: 0;
border-radius: 5px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
/* position: absolute; */
padding: 2px;
float: left;
}
.main-content{
/* margin: 15px; */
/* top: 30px; */
/* position: relative; */
width: 100%;
background: #F5F5F5;
float: left;
clear: left;
}
.main-content should not have relative position. For mobile responsive styles, you can use col-sm- and col-xs-:
.each-entry-box {
min-height: 80px;
max-height: 110px;
width: 80%;
background: #F5F5F5;
margin: 10px;
border-radius: 5px;
position: relative;
}
.each-entry-box-header {
height: auto;
width: 100%;
background: #E6E6FA;
margin: 0;
border-radius: 5px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
position: absolute;
padding: 2px;
}
.main-content {
margin: 15px;
margin-top: 25px;
width: 100%;
}
<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.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="each-entry-box row">
<div class="each-entry-box-header">
<div class="col-md-9 customer-name col-sm-9 col-xs-8">
<i class="glyphicon glyphicon-user glyphicon-class"></i><span>customer name</span>
</div>
<div class="col-md-3 added-on col-sm-3 col-xs-4">
<i class="glyphicon glyphicon-time glyphicon-class"></i><span>time</span>
</div>
</div> <!-- each-entry-box-header ends here -->
<div class="main-content">
<div class="col-md-12">
<div class="col-md-3 customer-mobile col-sm-3">
<i class="glyphicon glyphicon-earphone glyphicon-class"></i><span>mobile number</span>
</div>
<div class="col-md-9 customer-email col-sm-9">
<i class="glyphicon glyphicon-envelope glyphicon-class"></i><span>No email ID added</span>
</div>
</div>
<div class="col-md-12">
Material : None
</div>
<div class="col-md-12">
<div class="col-md-4">
XYZ : None
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
</div>
</div>
</div>
</div>

How to use CSS selectors select child of H5 in this case? [duplicate]

This question already has answers here:
How do I vertically center text with CSS? [duplicate]
(37 answers)
Closed 6 years ago.
I am styling steps 1,2,3 for my landing page. I use the bootstrap framework in this case.
What I want is just move text for step 1 and step 3 down a little bit but leave step 2 as normal.
.steps:.step:first-child:last-child h5 {
margin-top: 25px;
}
.step {
padding-left: 130px;
padding-top: 12px;
padding-bottom: 25px;
background-color: black;
height: 110px;
border: 2px solid #62a9af;
border-radius: 60px 0px;
}
.step .number {
position: absolute;
top: 14px;
left: 25px;
font-family: "Oswald", sans-serif;
color: #ffbe01;
font-size: 4em;
line-height: 1.4em;
text-align: center;
width: 1.5em;
height: 1.5em;
background-color: rgba(98, 169, 175, 0.25);
border-radius: 50%;
}
.step h5 {
font-family: "Oswald", sans-serif;
font-size: 2em;
color: white;
font-weight: 500;
text-transform: uppercase;
}
.steps {
margin-top: 10px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<section class="steps">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">1</div>
<h5>REGÍSTRATE</h5>
<p></p>
</div>
</div>
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">2</div>
<h5>SIGUE LAS INSTRUCCIONES</h5>
<p></p>
</div>
</div>
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">3</div>
<h5>¡JUEGA!</h5>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
My Codepen
I don't think that's the best way to solve the problem you're facing, I think you should use flexbox, it's a lot more responsive. Here's my code.
* {
font-family: Oswald, sans-serif;
}
.step {
background-color: #000;
height: 110px;
border: 2px solid #62a9af;
border-radius: 60px 0;
display: flex;
align-items: center;
}
.step .number {
color: #ffbe01;
font-size: 4em;
line-height: 1.4em;
text-align: center;
width: 1.5em;
height: 1.5em;
background-color: rgba(98, 169, 175, .25);
border-radius: 50%;
margin: 15px;
}
.step h5 {
font-size: 2em;
color: #fff;
font-weight: 500;
text-transform: uppercase;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<section class="steps">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">1</div>
<h5>REGÍSTRATE</h5>
<p></p>
</div>
</div>
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">2</div>
<h5>SIGUE LAS INSTRUCCIONES</h5>
<p></p>
</div>
</div>
<div class="col-xs-12 col-sm-offset-3 col-sm-7 col-md-offset-0 col-md-4">
<div class="step">
<div class="number">3</div>
<h5>¡JUEGA!</h5>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I've simplified your CSS a little, and also changed how your number is added. You'll notice display: flex; and align-items: center; are now in .step this means everything inside .step is vertically central.
Now the text in each step will look central no matter how many lines they take up.
I hope this helps.
Just add an id for the 2 steps:
HTML:
<h5 id="heightdown">REGÍSTRATE</h5>
<h5 id="heightdown">¡JUEGA!</h5>
CSS:
#heightdown {
padding-top: 5px;
}

Trouble with a checkbox inside a div with a dynamic height, how to do?

I've got a lot of trouble with getting my checkboxes vertical aligned in my divs with a dynamic height.
I have some of my view:
<div class="col-md-7">
<div class="row recent-information">
<div class="product-navigation">
<div class="product-header-text">
<div class="col-md-3 product-details">
<p>Product name</p>
</div>
<div class="col-md-4 product-details">
<p>Note</p>
</div>
<div class="col-md-2 product-details">
<p>Price</p>
</div>
<div class="col-md-2 product-details">
<p>Stock</p>
</div>
</div>
</div>
#foreach (var item in Model.Products)
{
<div class="product-header">
<div class="product-header-text">
<div class="col-md-3 product-details-entity">
<h6>#item.Name</h6>
</div>
<div class="col-md-4 product-details-entity">
<h6>#item.Description</h6>
</div>
<div class="col-md-2 product-details-entity">
<h6>#item.Price DKK</h6>
</div>
<div class="col-md-1 product-details-entity">
<h6>#item.Stock</h6>
</div>
<div class="col-md-1 product-details-checkbox">
#Html.CheckBox("naem", new { #class = "products-checkbox" })
</div>
</div>
</div>
}
</div>
</div>
And the style:
.product-header {
min-height: 7%;
min-width: 100%;
margin-bottom: 3px;
border-bottom: 1px solid #e6e6e6;
overflow: hidden;
}
.product-header-text {
width: 98%;
margin-left: 10px !important;
margin-right: 10px !important;
float: left;
font-weight: 700 !important;
margin-bottom: 3px;
height: 100%;
}
.product-details {
font-weight: 500 !important;
margin-top: 13px;
font-family: 'Raleway', sans-serif;
font-size: 12px;
height: auto;
min-height: 100%;
}
.product-details-entity {
margin-top: 20px;
height: auto;
}
input[type="checkbox"] {
background: #f8f8f5;
-webkit-appearance: none;
height: 22px;
width: 22px;
margin-top: 20%;
cursor: pointer;
margin-left: 65px;
}
input[type="checkbox"]:checked {
background-image: url("../Images/checkmark2.png");
height: 22px;
width: 22px;
}
My problem is, that my divs, the product-details are dynamically based on the content from the database, and I can't get my checkboxes to follow.