How can I move text to the left with CSS?
Tags: html,css
Problem :
I have some text that is inside a span
element and I'd like to left-align it instead of the way it is now which is centered. I tried making a margin to the right and text center with CSS but that didn't work. Can you tell me how to do it? The text that I want to the left is "(Jag arbetade: 4-6 timmar/vecka)" and now it is rendered centered if you look at my fiddle
The code that I'd like to change is
<div id="i4c2" class="artBaseRow">
<div id="i4_tbl_11" class="artWrapper">
<table class="srtbl" cellpadding="2" cellspacing="0" summary="">
<caption><b>Vad var det bästa med kursen?</b></caption>
<tbody>
<tr class="srtbl-h1">
<th class="srtbl-qt">
<div>
<br /> <span>(Jag arbetade: 4-6 timmar/vecka)</span>
</div>
</th>
</tr>
</tbody>
</table>
</div>
</div>
So that the text "(Jag arbetade..." is aligned to the left alongside the heading. How can I do that?
Solution :
Add this css for srtbl-qt
class (try put it at the end of CSS file)
.srtbl-qt {
text-align: left;
}
Also I don't know why you need div and break and span elements around that text, but it can be removed (hint: th {padding-top: 10px;}
)
CSS Howto..
One quick solution would be to give the parent element a max-width equal to the initial width of the element. In doing so, the element will still be centered relative...
I was unable to add html in language file because in model the method used to send mail was using $mail ->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8')); I have changed this to :...
For elements whose layout is governed by the CSS box model, the transform property does not affect the flow of the content surrounding the transformed element. REF: Transform Rendering...
Add this style (tested both on Chrome and Firefox) label { display: block; padding-left: 1.5em; text-indent: -.7em; } http://jsfiddle.net/tkt4zsmc/2/ Final result: ...
Solution 1 (hide excess content to keep equal heights) You can avoid this behavior by not allowing your <h5>s in your <li>s to wrap, using the CSS below. I also...
I added text-center class to align the menu items to center. Added display:block to menu item. Check static code here. #logosignin img { width: 250px; height: auto; margin: 0 auto;...
// get a reference to radio button and attach change handler $('input[id*="rdAnsBool"]').change(function(){ var container = $(this).closest('div.Ans'), questionid = $(this).attr('id'), index = questionid[questionid.indexOf('rdAnsBool') + 1]; // test for condition and set...
You can use dictionary-based completion. Put all your identifiers in a file, say /path/to/project/cssdict.txt. Framework_Table FrameWork_NumberInput Framework_TextOutput In Vim, do :setlocal dictionary=/path/to/project/cssdict.txt. Hit <C-x><C-k> to complete using that dictionary. Read...
Here is a step by step guide: Go to Font Squirrel and download the @font-face kit. Unzip it, rename it to 'fonts', and put it in the same directory as...
You can simply do: $('.dropdown-menu li a').click(function(){ alert($(this).text()); }); DEMO The idea is to find the common pattern among the dropdowns, which is the class .dropdown-menu and then bind the...
To accomplish this you set float:right to the element which you always want to be visible and you set display:block to the other element with the ellipsis. FIDDLE Markup <div...
Use the #{} interpolation notation to treat your variables as strings. Since Sass cannot perform arithmetic on strings, the / gets treated as a literal slash instead of the division...
It's not possible in CSS3, the best you can do is select only the <ul> which follow <p>: p + ul { /*...*/ } However it will be possible when...
You can simply add this line to bootstrap.min.css file, and this rule will work fine!
You need to set the CSS vertical-align property to top on the generated HTML <td> element. Assuming that you want to apply this on the entire <p:panelGrid> throughout all pages,...
#left { float: left; width: 200px; } #right {width:auto; overflow:hidden} #first { background: #ccc; } #second, #third { width: 48%; background: #333; float:left } #third { background: #000; } ...
Use the CSS attribute selector syntax: div[data-uid="20"] { background:red; } <div class="nx-field nx-modified required" data-uid="20"> <textarea></textarea> </div> <div class="nx-field nx-modified required" data-uid="21"> <textarea></textarea> </div> ...
The Gantry Framework uses compiled LESS files. Rather than editing these directly, it is recommended (as you have done) that a custom CSS or custom LESS file is created so...
.calParameter { background-color:darkgray; text-align:center; } Keep the colspan attribute and get rid of the align attribute. Change your css to what I have above. colspan is an attribute made for...
I was asking a similar question a few months ago. It seems you can not check the contents of elements, so no. Stay with the javascript.
Place the text in your alt= tag. That should show the text when images are blocked. (That's pretty much the purpose of the alt tag, to represent content when a...
<edit> to get li active overflowing over top of its parent, you need to set negative margins too : DEMO updated CSS from original answer (at bottom): .menu-holder{ height: 30px;...
<div id="wrap_video"> <video id="player" width="960px" height="720px" loop="loop"> <source src="mov/movie.mp4" type="video/mp4"/> <source src="movie.ogg" type="video/ogg" /> Your browser does not support this streaming content. </video> <div id="video_overlays"> <img...
in HTML code <div class="highlightRoundBox"> <span class="loading"> <span class="edge edge-left"></span> <span class="edge edge-right"></span> </span> </div> in CSS code @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg);...
This only works in IE!! Warning! <html> <head> <style type="text/css"> #fixedheight { table-layout: fixed; } #fixedheight td { height: 20px; overflow: hidden; width: 25%; } </style> </head> <body> <table id="fixedheight">...
If you don't want to use a framework (my advice is to use it for save a lot of money, however use ZURB foundation that is mobile-first design) you have...
I got some free time at job, so here's an example of what you are looking for (jsFiddle): [-] html <div class="wrapper"> <div class="container"> <img src="http://pipsum.com/200x150.jpg"> </div> <div class="container"> <img...
Made changes to your code. Please find updated CSS JSFIDDLE
Add the float property to the video tag. Give float: left. This will help you achieve what you want.
You can write like this: CSS span{ background: none repeat scroll 0 0 #F8F8F8; border: 5px solid #DFDFDF; color: #717171; font-size: 13px; height: 30px; letter-spacing: 1px; line-height: 30px; margin: 0...