I want to have a Centered icon arrow.gif underneath a single Word of the headline h1. my Problem is that this word is followed by other words. how can I place the icon directly under this word in a way it is centered to this single word.
Maybe try this. but be careful. It's very limited if you have more workds or multiple lines.
.u-table {
display: table !important;
}
.u-table-cell {
display: table-cell !important;
}
.u-text-center {
text-align: center !important;
}
<h1 class="u-table">
<span class="u-table-cell u-text-center">Word 1<br/><img src="" alt="Foo"></span>
<span class="u-table-cell">word 2</span>
</h1>
Related
my web's URL
How to move the words in green frame into the red frame? I set up my css but
it doesn't change, where is the problem?
Where is the problem? and how to fix it??
Can you help me please to solve this problem?
Thanks in advance!
html code:
<div class="topmenu">
<a type="button" class="btn btn-flat text-white">儲存</a>
<a type="button" class="btn btn-flat text-white">陳核</a>
<a type="button" class="btn btn-flat text-white">退文</a>
<a type="button" class="btn btn-flat text-white">決行</a>
<a type="button" class="btn btn-flat text-white">關閉</a>
</div>
css code:
.topmenu {
text-align:center !important; }
In this case text-align: center !important won't work due to the fact that your element is not covering the whole navbar so it is centered already.
width: 100%; solution
So you should make your div maximize to its available space with width: 100%; and then use text-align: center; so the output should be something like this:
.topmenu {
text-align: center;
width: 100%;
}
NOTE: It won't perfectly work if you add extra elements to your navbar.
Margin auto solution
The other approach to achieve this is to force the div to have a specific space with their adjacents by using margin: 0 auto;. like this one:
.topmenu {
margin: 0 auto;
}
NOTE: Since you got an empty div in the left side of the nav elements <div class="search-form d-none d-lg-inline-block"></div>, this may look weird in the first place, but whenever you delete that empty div or try to import your search input within it you will see the results and would be working perfectly.
When going to the URL you provided and opening the DevTools, I can see that you have
<div class="navbar-right">
<ul class="nav navbar-nav">...</ul>
</div>
If you provide more samples of the code you're using, we can direct you better on what changes you need to make.
Width of your div is adapted to its content and pulled to right.
Try to do this in your css,
css code: .topmenu { text-align:center !important; width:100%;}
I don't know exactly what you mean, but in case you want to set your list in center vertically, you can use flexbox
.topmenu {
display: flex;
align-items: center;
}
Learn more about Flexbox
i want to move the text displayed at the bottom of font Awesome
enter image description here
i just want to use css ,html to make something like in the image
1- add container for the icon and the text
2- add center the content in the container
3- add style to the icon
4- you can repeat the icon container to make as many as you want copies
HTML :
<div class="icon-container">
<i class="fa fa-home icon"></i> <!-- this should be your icon -->
<h3>sturdy themes</h3>
<p>our themes are updated regularly to keep them bug free!</p>
</div>
CSS :
.icon-container {
width: 300px;
text-align: center;
}
.icon-container p {
color : #b2b2b2;
}
.icon-container i {
color : orange;
font-size: 100px;
}
I am trying to make the "alt" text of the brand-logo and brand-logo-collapsed link white instead of the default blue like all the other ones. But am unable to figure out the proper css to specifically call that portion. Will someone please guide me in the correct direction.
<a href="#/" class="navbar-brand">
<div class="brand-logo">
<img src="#" alt="Dealer Tracking" class="img-responsive">
</div>
<div class="brand-logo-collapsed">
<img src="#" alt="Dealer Tracking" class="img-responsive">
</div>
</a>
CSS
a > navbar-brand > img {
color: #fff;
}
Your element with navbar-brand class is the same element as the anchor, so need to be treated as such in the CSS (be removing the space in between). Also classnames should be prepended with a ., and as you have a div in between the image and the anchor, it will break the rule, as > only selected direct descendants, so get rid of that:
a.navbar-brand img {
color: #fff;
}
Should get it working.
You can do this:
.brand-logo > img, .brand-logo-collapsed img{
color: white;
}
And if you want to to this for all of your images:
img{
color: white;
}
So I'm simulating a table layout with a div and a couple spans inside it. I'd like the span on the right to indent any text that wraps. I've tried a few things and can't get it to work. Any help would be appreciated.
jsFiddle: http://jsfiddle.net/2Wbuv/
HTML
<div class="display-element">
<span class="display-label">Field 1</span>
<span class="display-field">This is my string of data, some times it is pretty long. Sometimes it is not. This one is.</span>
</div>
<div class="display-element">
<span class="display-label">Field 2</span>
<span class="display-field">This is another string of data.</span>
</div>
CSS
.display-element {}
.display-label {display: inline-block;
width: 100px;
padding-left: 5px;}
.display-field {display: inline;}
Check this out: http://jsfiddle.net/2Wbuv/2/
.display-element {
}
.display-label {
display: inline-block;
width: 100px;
padding-left: 5px;
}
.display-field {
display: inline-block;
padding-left: 50px;
text-indent: -50px;
vertical-align: top;
width: 200px; /* for testing purposes only */
}
<div class="display-element">
<span class="display-label">Field 1</span>
<span class="display-field">This is my string of data, some times it is pretty long. Sometimes it is not. This one is.</span>
</div>
<div class="display-element">
<span class="display-label">Field 2</span>
<span class="display-field">This is another string of data.</span>
</div>
It sounds like you want a hanging indent. CSS something like this should do the trick:
.hanging-indent
{
text-indent : -3em ;
margin-left : 3em ;
}
But since your <span> is an inline element, the text-indent property, as well as other CSS properties pertaining to a block, is meaningless.
The CSS 3 draft specifies a hanging indent. If supported by Browsers, the following should work:
.hanging-indent
{
text-indent: 3em hanging each-line;
}
Unfortunately neither hanging nor each-line values are currently supported in modern browsers as the specification for CSS Text Module Level 3 is still a Draft.
The feature is implemented with a browser specific prefix for WebKit and Chromium. For Firefox there is an open Bug you may vote on.
I'm trying to keep everything aligned vertically but can't seem to figure it out
here is the css
fieldset span{
padding:50px 10px 0px 10px;
float:left;
clear:none;
}
fieldset span.buttons{
float:right;
}
and the html markup
<fieldset class="remove">
<span class="itemtype">story</span>
<span class="itemtype">53547</span>
<span class="title">New online education program aimed at curbing dangerous drinking</span>
<span class="buttons">
<img src="img/edit.png" alt="edit story" />Edit
<img src="http://www.bibliomania.com/graphics/read.gif" alt="read story" />Read
</span>
<input type="hidden" name="featured[items][53547]" value="story" />
</fieldset>
and a fiddle you can see how the image pushes down also the text in the 'a' tag text needs to be corrected as well
edit
using background image would be nice but that makes the image go under the text see new fiddle
Try this :
fieldset span a img {
vertical-align: middle;
}
Vertical-align is a CSS property that is often misued to align text. However its aim is to align images (and yes, it also does align text but only in table).
See CSS-tricks.com - What is vertical-align
Fiddle to test
What about just using the padding for both top & bottom:
fieldset span{
padding:25px 10px 25px 10px;
...
http://jsfiddle.net/SxCH2/5/