I'm having difficulties aligning my headline and paragraph text in a "well". The "none" you see is a class to remove specific margins and is not relevant to what I'm trying to accomplish.
Here is my code
<div class="col-md-4 none">
<div class="well none">
<i class="fa fa-user fa-4x fa-fw"></i>
<h3>Test</h3>
<p>text goes here</p>
</div>
</div>
Here's what it's doing and what I want it to do.
Thanks for your help!
I would suggest you to make slight change in your html structure and wrap your text content inside the div and set its display as inline-block
<div class="col-md-4 none">
<div class="well none">
<i class="fa fa-user fa-4x fa-fw"></i>
<div class="text">
<h3>Test</h3>
<p>text goes here</p>
</div>
</div>
</div>
and css for that additional div is
.text {
display:inline-block;
}
Js Fiddle Demo
I would do this the following way. I like to use nested rows where ever possible to keep things clean.
/** CSS **/
.well h3 {
margin-top:0px;
}
.fs48 {
font-size:48px;
}
/** HTML **/
<div class='row'>
<div class='col-md-4'>
<div class='well'>
<div class='row'>
<div class='col-xs-3 text-center'>
<span class='glyphicon glyphicon-user fs48'></span>
</div>
<div class='col-xs-9'>
<h3>Test</h3>
<p>text goes here</p>
</div>
</div>
</div>
</div>
</div>
See a working example here : http://jsfiddle.net/D2RLR/6779/
You can simply replace the glyph with the font awesome class.
Related
i can't change my icon font "follow" on my footer.
<!--footer-->
<footer>
<div class="container text-center">
<div class="row">
<div class="col-sm-12">
<p>Copyright © 2020 | All Rights Reserved by <a href="https://twitter.com/gigihhimself">Gigih
Pratama</a></p>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<i class="fa fa-twitter" aria-hidden="true"></i> Follow
</div>
</div>
</div>
</footer>
<!--end footer-->
i can't change my icon font "follow" on my footer. help me with CSS
There is a css property font-family, you can set any font-family using that. In your case - you want to change the font-family of follow. Just give a class name to your a tag and set font-family for this class.
.follow {
font-family: Helvetica;
}
<div class="row">
<div class="col-sm-12">
<i class="fa fa-twitter" aria-hidden="true"></i> Follow
</div>
</div>
I've created a simple button link in my page with container-fluid and row classes so that I can take utilize the whole available width of the page for the link button.
However, my code doesn't result in the button taking full width of the page. Attached is the screenshot of the said output.
Please inform me as to what I'm doing incorrectly. Thanks in advance.
[Basically what I want is that the well in the below screenshot should take 100% (or atleast 90% and centered) of the page width.]
My HTML and CSS codes are mentioned below:
My HTML Code:
<div class="container-fluid">
<div class="row">
<section id="access_list_session" class="col-sm-12">
<br/>
<p id="form-header"> Access Colleague List </p>
<br /><br /><br />
<div class="row">
<div class="hidden-xs hidden-sm col-md-4">
<i class="fa fa-5x fa-cogs" aria-hidden="true"></i>
</div>
<div class="well col-xs-12 col-sm-12 col-md-8">
<div id="form_link">
<i class="fa fa-list-alt" aria-hidden="true"></i> Click to access our Colleague List<br /> <span style="font-size: 10px; text-align:center;"">(Use of this list is subject to our Privacy Policy and other T&C)</span>
</div>
<br/>
<hr>
<p> In case of any difficulty please contact the site administrator using the form below.</p>
</div>
</div>
</section>
</div>
</div>
My CSS Code
#form_link a
{
width: 100%;
font-size: 1em;
}
.row
{
padding-top: 60px;
height: 60em;
width: 100%;
}
2 solutions IMHO :
Add in .row
.row {
margin: auto;
}
to center your block (see https://jsfiddle.net/os7frkq5/1/)
or simply delete width: 100% :
(see https://jsfiddle.net/os7frkq5/2/ )
I don't know if this is what you mean but you can try this:
<div class="container-fluid">
<section id="access_list_session" class="col-md-12">
<br/>
<p id="form-header"> Access Colleague List </p>
<br /><br /><br />
<div class="row">
<div class="hidden-xs hidden-sm col-md-4">
<i class="fa fa-5x fa-cogs" aria-hidden="true"></i>
</div>
<div class="well col-xs-12 col-sm-12 col-md-12">
<div id="form_link">
<i class="fa fa-list-alt" aria-hidden="true"></i> Click to access our Colleague List<br /> <span style="font-size: 10px; text-align:center;"">(Use of this list is subject to our Privacy Policy and other T&C)</span>
</div>
<br/>
<hr>
<p> In case of any difficulty please contact the site administrator using the form below.</p>
</div>
</section>
</div>
What you want is the a element to use block-display.
a { display: block }
Read up on the differences between inline and block elements, because it's vital to the way they're laid out.
This is what I want it to look like:
I am trying to create an html file that has 5 div boxes like the picture shown above. I have the first three done but I am not sure how to do the bottom two. Any help is appreciated
<div class="row divcenter" style="max-width: 1000px;">
<div class="col-sm-4 bottommargin">
<div class="team">
<div class="team-image">
<img src="images/team/1.jpg" alt="ThreatVulnManage">
<div class="team-overlay">
<div class="team-social-icons">
<a class="si-borderless si-facebook" title="Facebook">
<i style="color:#fff;padding-top: 10px"><ul>Penetration Testing</ul></i>
<i style="color:#fff"><ul>Vulnerability Scans</ul></i>
<i style="color:#fff"><ul>Red/Blue/Purple Team Exercise</ul></i>
<i style="color:#fff"><ul>Black Team</ul></i>
</a>
</div>
</div>
</div>
<div class="team-desc team-desc-bg">
<div class="team-title"><h4>Threat & Vulnerability Management</h4></div>
</div>
</div>
</div>
<div class="col-sm-4 bottommargin">
<div class="team">
<div class="team-image">
<img src="images/team/2.jpg" alt="EnterpriseRiskCompliance">
<div class="team-overlay">
<div class="team-social-icons">
<a class="si-borderless si-facebook" title="Facebook">
<i style="color:#fff"><ul>IT Security Assessment & Cyber Breach Risk Assessment</ul></i>
<i style="color:#fff"><ul>HIPAA & PCI-DSS</ul></i>
<i style="color:#fff"><ul>Third-Party Vendor Risk Assessment</ul></i>
<i style="color:#fff"><ul>Cloud App Risk Assessment</ul></i>
<i style="color:#fff"><ul>Data Discovery Mapping & Classification</ul></i>
<i style="color:#fff"><ul>Compliance Management</ul></i>
</a>
</div>
</div>
</div>
<div class="team-desc team-desc-bg">
<div class="team-title"><h4>Enterprise <br>Risk & Compliance</h4></a></div>
</div>
</div>
</div>
<div class="col-sm-4 bottommargin">
<div class="team">
<div class="team-image">
<img src="images/team/3.jpg" alt="SecurityProgramStrategy">
<div class="team-overlay">
<div class="team-social-icons">
<a class="si-borderless si-facebook" title="Facebook">
<i style="color:#fff;padding-top: 10px"><ul>Infosec Program Development</ul></i>
<i style="color:#fff"><ul>ISO 27002</ul></i>
<i style="color:#fff"><ul>NIST</ul></i>
</a>
</div>
</div>
</div>
<div class="team-desc team-desc-bg">
<div class="team-title"><h4>Security Program <br>Strategy</h4></div>
</div>
</div>
</div>
</div>
<div class="row divcenter" style="max-width: 1000px;">
<div class="col-sm-4 bottommargin">
<div class="team">
<div class="team-image element-5">
<img src="images/team/1.jpg" alt="Trust">
<div class="team-overlay">
<div class="team-social-icons">
<a class="si-borderless si-facebook" title="Facebook">
<i style="color:#fff;padding-top: 10px"><ul>T-Score</ul></i>
<i style="color:#fff"><ul>R-Score</ul></i>
<i style="color:#fff"><ul>PNProtect</ul></i>
<i style="color:#fff"><ul>Trust Restoration Framework</ul></i>
</a>
</div>
</div>
</div>
<div class="team-desc team-desc-bg">
<div class="team-title"><h4>Trust</h4></div>
</div>
</div>
</div>
<div class="col-sm-4 bottommargin">
<div class="team">
<div class="team-image element-4">
<img src="images/team/2.jpg" alt="EducationAwareness">
<div class="team-overlay">
<div class="team-social-icons">
<a class="si-borderless si-facebook" title="Facebook">
<i style="color:#fff;padding-top: 10px"><ul>Security Awareness Training</ul></i>
<i style="color:#fff"><ul>Secure Code Review Training</ul></i>
<i style="color:#fff"><ul>Human Breach Prevention Project</ul></i>
</a>
</div>
</div>
</div>
<div class="team-desc team-desc-bg">
<div class="team-title"><h4>Education & Awareness</h4></div>
</div>
</div>
</div>
Hard to say exactly, without knowing how you're structuring your code. If everything is within one container, you could set it's text-align to center and have the elements within it have display: inline-block.
<div class="wrapper">
<div class="child">
<div class="child">
<div class="child">
<div class="child">
<div class="child">
</div>
And css:
.wrapper {
text-align: center;
}
.child {
display: inline-block;
width: 100px;
height: 100px;
background-color: #777777;
margin: 15px;
}
As long as the children are too wide to all fit on the same row in the wrapper, they'll move on to the next row. Alternatively you can place a <br> element to force them to wrap to a new row or just put them children in separate <div>s
I am very new to coding, and I'm sorry if this suggestion does not help you. I am trying to answer questions so maybe I can learn more myself.
I would do something like this in css:
#boxes {
float: left;
position: relative;
}
.box4 {
clear: left;
}
Then edit the margin accordingly.
I want the three div containers to line up side by side with a max-width of 1044px. I tried using col-md-4, because I have margin:20px, it pushed the third div container to the second row. I read up online, some people suggested using a div class="row", I tried that, end result is the same.
Here is my HTML:
<div class="engineering-section col-xs-12">
<div class="engineering-section-title title-text text-center">Engineering</div>
<div class="row">
<div class="card-container">
<div class="card-section col-md-4">
<div class="mdl-card__media">
<img src="img/engineer-1.jpg">
</div>
<div class="mdl-card__supporting-text">
<span class="mdl-typography--font-light mdl-typography--subhead">V8.8 aspenONE Enginnering Suite (May 2015)</span>
<div class="checksum">
<a class="info_checksum" href="#">Checksum</a>
</div>
</div>
<div class="card_actions">
<a class="card-links" href="#">
Download Now
<i class="fa fa-chevron-right"></i>
</a>
</div><!--end card_actions-->
</div><!--end mdl-cell-->
<div class="card-section col-md-4">
<div class="mdl-card__media">
<img src="img/engineer-2.jpg">
</div>
<div class="mdl-card__supporting-text">
<span class="mdl-typography--font-light mdl-typography--subhead">V8.8 aspenONE Process Manuals and Process Tools</span>
<div class="checksum">
<a class="info_checksum" href="#">Checksum</a>
</div>
</div>
<div class="card_actions">
<a class="card-links" href="#">
Download Now
<i class="fa fa-chevron-right"></i>
</a>
</div><!--end card_actions-->
</div><!--end mdl-cell-->
<div class="card-section col-md-4">
<div class="mdl-card__media">
<img src="img/engineer-3.jpg">
</div>
<div class="mdl-card__supporting-text">
<span class="mdl-typography--font-light mdl-typography--subhead">Aspen License Deployment Assistant</span>
<div class="checksum">
<a class="info_checksum" href="#">Checksum</a>
</div>
</div>
<div class="card_actions">
<a class="card-links" href="#">
Download Now
<i class="fa fa-chevron-right"></i>
</a>`enter code here`
</div><!--end card_actions-->
</div><!--end mdl-cell-->
</div><!--end row-->
</div><!--end card-container-->
Remove custom styles of margin from card-section class. It will work
You have to follow these 3 rules :
Rows must be placed within a .container (fixed-width) or
.container-fluid (full-width) for proper alignment and padding.
Use rows to create horizontal groups of columns.
Content should be placed within columns, and only columns may be immediate children of rows.
It should look like this :
<div class="container-fluid"><!--<div class="container">-->
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
</div>
See this link for more information about the Bootstrap responsive design :
http://getbootstrap.com/css/
You are doing wrong here
<div class="card-section col-md-4">
Put card-section inside col-md-4
<div class="col-md-4">
<div class="card-section">
it can give you the space between 3 cols and you can style the content too
and remove margin: 20px; it's unnecessary now.
Fiddle example
I simply want to center text in a div.
I've found center-block to no avail,
also text-align to no avail...
<div class="row">
<div class="col-xs-4">
<span style="background:black; color:white">
Ad Analytics and Attribution.
</span>
</div>
<div class="col-xs-4">
<div class="center-block">
<span style="background:black; color:white">
Addressable Audiences.
</div>
</div>
<div class="col-xs-4">
<span style="background:black; color:white">
Affiliate Apps.
</div>
</div>
You're looking for class="text-center" -- http://getbootstrap.com/css/#type-alignment
Use .text-center for span to make the text center
Reference URL