I'm trying to create some nice looking blockquotes in Bootstrap by stacking some rows with quotes above and below the quotation, like so just to give you a rough example ( can be seen here (http://www.bootply.com/weEUvuQfw2 ). As seen in the bootply example, the left quotation mark hovers high above the quote, since its character is originally that high when used in a sentence. I imagine it's got to be something simple, but what can I do to get the left quote to hover at the bottom of the top left cell of this grid? setting a negative margin or padding doesn't seem to do it. Any ideas?
<div class="container">
<div class="row right">
<div class=" col-lg-3 ">
<font size="40">“</font>
</div>
<div class="col-lg-6 ">
</div>
<div class="col-lg-3 ">
</div>
</div>
<div class="row center">
<div class=" col-lg-3 ">
</div>
<div class="col-lg-6 ">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet blandit libero. Nullam at tincidunt risus. Nam quis suscipit ligula, ut cursus nunc. Nulla eget eros diam. Aenean bibendum accumsan velit in dapibus. Pellentesque sodales leo nec lacus consequat, nec tempor nibh sollicitudin. Fusce mollis luctus ultrices. Quisque tempus placerat velit, at varius libero pulvinar eu. Curabitur sit amet est velit. Praesent id eleifend nulla, eu iaculis lacus. Integer imperdiet, tellus nec tristique mattis, magna quam luctus tellus, nec semper enim felis eget nisl.
</div><!--
--><div class="col-lg-3 ">
</div>
</div>
<div class="row left">
<div class=" col-lg-3 ">
</div>
<div class="col-lg-6 ">
</div><!--
--><div class="col-lg-3 ">
<font size="72">”
</font></div><font size="72">
</font></div><font size="72">
</font></div><!-- /.container -->
And CSS
.center {
text-align: center;
}
.right {
text-align: right;
}
.left {
text-align: left;
}
Are you looking for something like so?
HTML:
<div class="container">
<div class="row right">
<div class=" col-lg-3 ">
<font size="40">“</font>
</div>
<div class="col-lg-6 ">
</div><!--
--><div class="col-lg-3 ">
</div>
</div>
<div class="row center">
<div class=" col-lg-3 ">
</div>
<div class="col-lg-6 ">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet blandit libero. Nullam at tincidunt risus. Nam quis suscipit ligula, ut cursus nunc. Nulla eget eros diam. Aenean bibendum accumsan velit in dapibus. Pellentesque sodales leo nec lacus consequat, nec tempor nibh sollicitudin. Fusce mollis luctus ultrices. Quisque tempus placerat velit, at varius libero pulvinar eu. Curabitur sit amet est velit. Praesent id eleifend nulla, eu iaculis lacus. Integer imperdiet, tellus nec tristique mattis, magna quam luctus tellus, nec semper enim felis eget nisl.
</div><!--
--><div class="col-lg-3 ">
</div>
</div>
<div class="row left">
<div class=" col-lg-3 ">
</div>
<div class="col-lg-6 ">
</div><!--
--><div class="col-lg-3 ">
<font size="72">”
</font></div><font size="72">
</font></div><font size="72">
</font></div><!-- /.container -->
CSS:
.center {
text-align: center;
}
.right {
text-align: left;
margin-bottom: -20px;
}
.left {
text-align: left;
}
Here is a fiddle: http://jsfiddle.net/4g0gp5pp/
That's a lot of markup to create something really simple.
DEMO: http://jsbin.com/hadapo/1/edit
HTML:
<blockquote class="quotemarks">
<p>Words go here</p>
<footer>Someone</footer>
</blockquote>
CSS
.quotemarks:before,
.quotemarks:after {
text-align: center;
font-size: 60px;
line-height: 1;
}
.quotemarks:before {
content: "\201C";
position: relative;
bottom: -20px;
}
.quotemarks:after {
content: "\201D"
}
.quotemarks {
border: 0;
padding: 0;
text-align: center;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.quotemarks footer {
text-indent: -10px
}
Related
I've been looking around for some time but couldn't find a solution.
So I'm working on a Personal portfolio with different sections (height: 100vh;). The problem I have is that I'm unable to position the images within the section itself (I want the image of the pinguïns to be positioned like the first lion image. But in the section below.). Can someone help me with this? (I'm using a bootstrap grid)
Code:
.section-1 {
background: radial-gradient(#2d2d2d, #1a1a1a);
height: 100vh;
}
.section-2 {
background: #fc6621;
height: 100vh;
}
.section-3 {
background: #20468b;
height: 100vh;
}
.col-sm-6 {
height: 100vh;
}
#profile img {
display: inline;
float: right;
position: absolute;
bottom: 0;
right: 0;
z-index: 0;
}
.center {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
}
.text {
height: 100vh;
position: relative;
z-index: 10;
}
<!-- 1st section -->
<div class="section-1">
<div id="profile"><img src="https://i.gyazo.com/4cefd23a7fdc59ac022cc46d44fe9321.jpg" width="1006" height="821"></div>
<div class="container">
<div class="row">
<div class="col-sm-6 center text">
<h1>I'm <strong>Gilles</strong></h1>
<p>Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit. Vestibulum id ligula porta felis euismod semper. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam
id dolor id nibh ultricies vehicula ut id elit. Donec sed odio dui. Cras mattis consectetur purus sit amet fermentum.</p>
<div class="col-sm-4 button">CONTACT ME</div>
</div>
</div>
</div>
</div>
<!-- 2nd section -->
<div class="section-2">
<div id="smartschool"><img src="https://i.gyazo.com/abdeb771b58043c53cfb08e5ffd42f6e.jpg" width="990" height="753"></div>
<div class="container">
<div class="row">
<div class="col-sm-6 center text">
<h1>I'm <strong>Gilles</strong></h1>
<p>Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit. Vestibulum id ligula porta felis euismod semper. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam
id dolor id nibh ultricies vehicula ut id elit. Donec sed odio dui. Cras mattis consectetur purus sit amet fermentum.</p>
<div class="col-sm-4 button">READ MORE</div>
</div>
</div>
</div>
</div>
<!-- 3th section -->
<div class="section-3">
<div id="dutchcreativestudio"><img src="https://i.gyazo.com/4cefd23a7fdc59ac022cc46d44fe9321.jpg" width="933" height="643"></div>
<div class="container">
<div class="row">
<div class="col-sm-6 center text">
<h1>I'm <strong>Gilles</strong></h1>
<p>Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam id dolor id nibh ultricies vehicula ut id elit. Vestibulum id ligula porta felis euismod semper. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam
id dolor id nibh ultricies vehicula ut id elit. Donec sed odio dui. Cras mattis consectetur purus sit amet fermentum.</p>
<div class="col-sm-4 button">READ MORE</div>
</div>
</div>
</div>
</div>
The first one does the right thing!
But then it gets a mess (or they stack above each other)
position: absolute; is relative to the nearest parent. if no parents have a set position, it will be relative to the body which is what seems to be happening here.
so each 100vh section will need to have position: relative;
its also worth noting that float won't do anything on an element with absolute positioning, since position: absolute; takes the element out of the document flow.
I am trying to create this in bootstrap 3:
However, right now I have got this:
My image is not lined up perfectly with the h4 tag and my p tags will not stay in a line as the first image. I am using bootstrap 3, so I am getting used it everything, and I was wondering if anyone can help me achieve this look. So far I have:
.col-content {
overflow: hidden;
padding: 0 15px;
}
.col-content p {
font-size: 13px;
font-weight: normal;
text-align: center;
}
.col-icon {
font-size: 48px;
float: left;
padding: 20px 10px;
text-align: left;
}
<div class="row">
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Web <span class="highlight">Development</span></h4>
<p>Praesent sodales, quam vitae gravida interdum, ex mi bibendum enim, sit amet tristique mi quam vel odio. Donec non nunc condimentum, hendrerit elit sed, condimentum magna. Suspendisse imperdiet purus vel ornare cursus.</p>
</div>
</div>
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Internet <span class="highlight">Marketing</span></h4>
<p>Curabitur et diam elementum, mollis tortor a, malesuada turpis. Vivamus gravida, justo et molestie sollicitudin, erat lorem tempus eros, vel laoreet nibh urna ac nunc, vestibulum neque vitae pellentesque efficitur.</p>
</div>
</div>
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Client <span class="highlight">Support</span></h4>
<p>Sed porta erat vel ipsum maximus, eget maximus est maximus. Maecenas at venenatis nibh, sit amet suscipit odio. In feugiat vehicula dui. In felis enim, maximus a dolor semper efficitur elit euismod magna quis commodo.</p>
</div>
</div>
</div>
I am just trying to make it look like the first image with bootstrap 3.
remove text-align: center from .col-content p to avoid the text-centering in the paragraphs and change padding: 20px 10px; to padding: 0 10px 20px 10px; in .col-icon to move the icons up to the top of their container:
https://codepen.io/anon/pen/wpaebo
for line up use display:inline-flex;align-item: flex-start; and remove text-align: center; from p tag
Use a combination of top and left while making the icon position:relative
position: relative;
top: -11px;
left: 8px;
.col-content {
overflow: hidden;
padding: 0 15px;
}
.col-content p {
font-size: 13px;
font-weight: normal;
text-align: center;
}
.col-icon {
font-size: 48px;
float: left;
text-align: left;
position: relative;
top: -11px;
left: 8px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<div class="row">
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Web <span class="highlight">Development</span></h4>
<p>Praesent sodales, quam vitae gravida interdum, ex mi bibendum enim, sit amet tristique mi quam vel odio. Donec non nunc condimentum, hendrerit elit sed, condimentum magna. Suspendisse imperdiet purus vel ornare cursus.</p>
</div>
</div>
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Internet <span class="highlight">Marketing</span></h4>
<p>Curabitur et diam elementum, mollis tortor a, malesuada turpis. Vivamus gravida, justo et molestie sollicitudin, erat lorem tempus eros, vel laoreet nibh urna ac nunc, vestibulum neque vitae pellentesque efficitur.</p>
</div>
</div>
<div class="col-md-4">
<div class="col-icon">
<i class="fa fa-lightbulb-o"></i>
</div>
<div class="col-content">
<h4>Client <span class="highlight">Support</span></h4>
<p>Sed porta erat vel ipsum maximus, eget maximus est maximus. Maecenas at venenatis nibh, sit amet suscipit odio. In feugiat vehicula dui. In felis enim, maximus a dolor semper efficitur elit euismod magna quis commodo.</p>
</div>
</div>
</div>
I am trying to get my login form in the middle of the screen and the company logo on the right above.
In the picture this is what I want to make in bootstrap.
This is my HTML code:
<div class="row">
<div class="col-sm-3">
.col-sm-3
</div>
<div class="col-sm-6">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">
Sign In
</div>
<div class="forgot-password">
Forgot password?
</div>
</div>
<div class="panel-body body-panel-styling">
<form class="form-horizontal" id="loginform"></form>
</div>
</div>
</div>
<div class="col-sm-3">
<img alt="Cerrix" class="img-responsive" src="~/Images/Cerrix-Logo.gif">
</div>
</div>
I already try this website but no luck
https://css-tricks.com/centering-css-complete-guide/
How can I center the login form in the middle of the screen and the company logo on the right above side of the screen?
Kind regards
UPDATE: jsfiddle
https://jsfiddle.net/fok6f2fc/
Would something like this match your needs? Login box centered horizontally and vertically with 100% height columns. Best viewed here on CodePen.
html,body,.container {
height: 100%;
}
#login-box {
display: table;
height: 100%;
}
.container {
display: table;
width: 100%;
padding: 0;
box-sizing: border-box;
}
.row {
height: 100%;
display: table-row;
}
.row .no-float {
display: table-cell;
float: none;
vertical-align: top;
}
.new {
display: table-cell;
vertical-align: middle;
float: none;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-md-3 no-float">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dui augue, sollicitudin et tortor sodales, mollis luctus massa. Praesent non tincidunt neque. Pellentesque facilisis maximus risus, ut porta risus vulputate in. Aliquam erat volutpat. Ut neque mi, tincidunt accumsan diam sed, vehicula vulputate ante. Morbi congue purus nulla, a sodales mi pellentesque id. Vestibulum tempor diam cursus nunc convallis, ac vehicula ipsum faucibus. Aenean malesuada pretium est, id laoreet diam aliquam porta. Aenean elementum pharetra leo id consequat. Pellentesque nec odio leo. Donec luctus nibh orci, sit amet malesuada risus suscipit eget. Maecenas aliquet odio nec vulputate vestibulum. Fusce tincidunt enim a mauris ornare, id iaculis nunc luctus. Donec placerat ex in lorem semper faucibus. Praesent ut tempus erat.</p>
</div>
<div class="col-md-12" id="login-box">
<div class="new"><div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">Sign In</div>
<div class="forgot-password">Forgot password?</div>
</div>
<div class="panel-body body-panel-styling">
<form id="loginform" class="form-horizontal" role="form">
<div class="input-group styling-field">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input id="login-username" type="text" class="form-control" name="username" value="" placeholder="username">
</div>
<div class="input-group styling-field">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input id="login-password" type="password" class="form-control" name="password" placeholder="password">
</div>
<div class="form-group styling-button">
<div class="col-sm-12 controls">
Login
</div>
</div>
</form>
</div>
</div></div>
</div>
<div class="col-md-3 no-float">
<div class="row">
<div class="col-md-12">
<img src="http://placehold.it/300x100" class="img-responsive">
</div>
</div>
<div class="row">
<div class="col-md-12">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dui augue, sollicitudin et tortor sodales, mollis luctus massa. Praesent non tincidunt neque. Pellentesque facilisis maximus risus, ut porta risus vulputate in. Aliquam erat volutpat. Ut neque mi, tincidunt accumsan diam sed, vehicula vulputate ante. Morbi congue purus nulla, a sodales mi pellentesque id. Vestibulum tempor diam cursus nunc convallis, ac vehicula ipsum faucibus. Aenean malesuada pretium est, id laoreet diam aliquam porta. Aenean elementum pharetra leo id consequat. Pellentesque nec odio leo. Donec luctus nibh orci, sit amet malesuada risus suscipit eget. Maecenas aliquet odio nec vulputate vestibulum. Fusce tincidunt enim a mauris ornare, id iaculis nunc luctus. Donec placerat ex in lorem semper faucibus. Praesent ut tempus erat.
</div>
</div>
</div>
</div>
</div>
use flexbox to align the login form to the center of the parent container:
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
you'll need to extend the height of the your parent div <div class="row"> for the centered field to work. assuming you want this container to fill the whole page, you can use viewport units to achieve it:
https://www.sitepoint.com/css-viewport-units-quick-start/
Okay guys so I have this green container:
And I need the text - Would you like to chat ? - to be at the bottom of it's parent (the green background)
I tried adding a style to the text like this:
<div class="row" style="position: relative;">
<div style="position: absolute; bottom:0; right:0;"> Would you like to chat ? </div>
</div>
But that did not work, the text is just over another text, not bottom.
I do not want to use margin-top, because it won't be good at mobile screens.
Here is the code:
<!-- About page -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-6 bg-success">
<div class="col-lg-6">
<img src="images/girlprofile.jpg" class="img-responsive" alt="pic1notworking" height="220" width="220" style="padding-bottom: 25px; padding-top: 15px;">
</div>
<div class="col-lg-6" style="padding-bottom: 25px; padding-top: 15px;">
<center>
<div class="usernamestyle"> Username <br> </div>
<div class="onlinestyle">
is currently online <br>
Would you like to chat ? <br>
</div>
</center>
</div>
</div>
<div class="col-lg-6">
<p style="font-size: 140%">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum, felis ac tristique tempor, tortor justo fringilla erat, id porta dui nisl quis leo. Proin non quam vitae erat placerat tincidunt. Mauris aliquam tempor finibus. Nulla a purus vehicula, tempus augue placerat, tincidunt odio. Mauris aliquet placerat urna vitae fermentum. Duis posuere risus ac elit mattis gravida. Pellentesque a quam eu massa efficitur aliquam. <br> <br>
Suspendisse tincidunt convallis nulla in pharetra. Ut ac erat convallis, dictum velit nec, sagittis ipsum. Quisque venenatis, nisi id consectetur imperdiet, nibh velit scelerisque arcu, ac placerat neque elit sit amet nisl. Aliquam nec dolor quam. Pellentesque maximus dui id justo ullamcorper auctor. Ut placerat purus vitae ipsum sodales, vel molestie magna finibus.
</p>
</div>
</div>
</div>
</div>
CSS:
.usernamestyle{
font-size: 200%;
}
.onlinestyle{
font-size: 160%;
}
<div class="col-lg-6" style="position: relative;height:100%; padding-bottom: 25px; padding-top: 15px;">
<center>
<div class="usernamestyle"> Username <br> </div>
<div class="onlinestyle">
is currently online
</div>
</center>
<div style="position: absolute; bottom:0; right: 0;">
Would you like to chat ?
</div>
</div>
I need the three div in the section to be centered in the middle of the section; they are off too the left too far right now.
<section class="support-feat clearfix">
<div class="container-fluid">
<div class="row box">
<div class="block about-feature-1 wow fadeInDown" data-wow-duration="500ms" data-wow-delay=".3s">
<h2>
text, Lorem ipsum dolor
</h2>
<p>
sit amet, quam donec libero suspendisse vel, neque nunc vel, donec massa turpis rutrum mauris, quam enim in dui sit penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque<br>sit amet, quam donec libero suspendisse vel, neque nunc vel, donec massa turpis rutrum mauris, quam enim in dui sit penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque
</p>
</div>
<div class="block about-feature-2 wow fadeInDown" data-wow-duration="500ms" data-wow-delay=".5s">
<h2 class="item_title">
text, Lorem ipsum dolor
</h2>
<p>
sit amet, quam donec libero suspendisse vel, neque nunc vel,
donec massa turpis rutrum mauris, quam enim in dui sit
penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque<br>sit amet, quam donec libero suspendisse vel, neque nunc vel, donec massa turpis rutrum mauris, quam enim in dui sit
penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque<br>
penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque
</p>
</div>
<div class="block about-feature-3 wow fadeInDown" data-wow-duration="500ms" data-wow-delay=".7s">
<h2 class="item_title">
text, Lorem ipsum dolor
</h2>
<p>
sit amet, quam donec libero suspendisse vel, neque nunc vel, donec massa turpis rutrum mauris, quam enim in dui sit penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque<br>
sit amet, quam donec libero suspendisse vel, neque nunc vel, donec massa turpis rutrum mauris, quam enim in dui sit penatibus ipsum, ut lacus lobortis. Vestibulum phasellus metus pellentesque
</p>
</div>
</div>
</div>
</section>
.support-feat {
text-align: center;
margin: 2%
}
.support-feat .block {
color: #1c1c1c;
flex: 2;
min-width: 340px;
max-width: 400px;
box-sizing: border-box;
}
.support-feat .block p {
font-weight: 300;
font-size: 140%
}
.support-feat h2 {
font-size: 200%
}
.support-feat .about-feature-1 {
padding: 20px;
background: #fff;
border: solid;
border-color: #17b6ea;
margin: 2%
}
.support-feat .about-feature-2 {
padding: 20px;
background: #fff;
border: solid;
border-color: #17b6ea;
margin: 2%
}
.support-feat .about-feature-3 {
padding: 20px;
background: #fff;
border: solid;
border-color: #17b6ea;
margin: 2%
}
Here's an image to explain what's going on and what I'm trying to do;
basically I'm trying to do what this does: https://www.tvlift.com/support/technical-support/
You can utilize bootstraps 12-column grid system to accomplish this... check out my jsfiddle below https://jsfiddle.net/gumctejp/
Basically you will format your page component to fit within the context of bootstraps grid system.
A really simple example would look like:
<div class="row text-center">
<div class="col-sm-3">
</div>
<div class="col-sm-2 box">
one box
</div>
<div class="col-sm-2 box">
two box
</div>
<div class="col-sm-2 box">
three box
</div>
<div class="col-sm-3">
</div>
</div>
See http://getbootstrap.com/css/ for the official documentation on boostraps grid system
As far as I understood, you wish to have centered floating items. This can be realized with some basic css:
HTML:
<div class="row">
<div class="col-xs-12 text-center">
<div class="floating-center">
Whatever content in here
</div>
</div>
</div>
Be sure to have all required elements in place when working with the bootstrap grid system (in your code, the column element was missing, leading to glitches sometimes).
CSS for the floating elements:
.text-center {
text-align: center;
}
.floating-center {
position: relative;
width: 500px;
height: auto;
margin: 5px; /*Whatever margin each element should have*/
display: inline-block; /*This is mainly doing the magic */
}
EDIT:
Added a plunker to show the effect: https://plnkr.co/edit/vGKHW8Pa1tw2RLlmj4BI?p=preview
Note: This is how to center the divs. Device dependant widths can be realized with css #media attribute.