I have a list of items where each item contains a header and a text. The item may also contain an image between the header and the text.
If the item contains an image, the header should be overlayed on top of the image.
How can I accomplish this by applying CSS to the following markup (which cannot be changed!):
<div class="wrapper">
<h2>First item</h2>
<img src="MyImage.jpg" width="400" height="200" />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Pellentesque in orci consectetur, auctor risus
sed, adipiscing neque. Integer ornare vestibulum
mauris, quis blandit nibh vestibulum sed.
</p>
</div>
<div class="wrapper">
<h2>Second item</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Pellentesque in orci consectetur, auctor risus
sed, adipiscing neque. Integer ornare vestibulum
mauris, quis blandit nibh vestibulum sed.
</p>
</div>
I've created a jsfiddle for you to play with: http://jsfiddle.net/9GSB8/
To overlay the header on top of the image I've tried setting "position: absolute" on the header. This works fine, but it will also make the header to be on top of the text when there is no image. This is my problem - to make it work both with and without the image.
Note that the header can be long enough that it will span over two rows.
Any help appreciated! :)
Related
im starting to creating my first wordpress themes, i added to my footer the Widget Text feature, is workign well, but is not adding me the paragraphs in the content, i try to check if there is some kind of enable option to html in the content Widget text.
The html looks like:
<div class="widget widget_text"><div class="title">Informação</div><div class="textwidget">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt viverra lectus ac venenatis. Nullam convallis, diam sed feugiat vehicula
</div>
</div>
When in reality i need in the textwidget wrapper classe be like (with paragraphs):
<div class="widget widget_text"><div class="title">Informação</div><div class="textwidget">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt viverra lectus ac venenatis. Nullam convallis, diam sed feugiat vehicula</p>
</div>
</div>
I already tried to but the paragraphs (p) tags in the widgets secton in CMS, but is not working.
Is there a option to activate the paragraphs in the WidgetText Wordpress? Im using the latest wordpress version (6.1.1).
regards
I am genrating Pdf using wkhtmltopdf so ,"text-align-last: justify" is
not working in pdf .Any one help me for this issue.
<p style="text-align:justify;text-align-last: justify;">*pginf*
Important Information Prior to Travelling to Brazil |b|</p>
Text-align help you to Stretches the lines and break in same line every time, I can figure out from your code you have less amount of paragraph text. Add more text then you can find out the result how text-align:justify work.
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Etiam semper diam at erat pulvinar, at pulvinar felis blandit.
Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut.</p>
p{
text-align:justify;
}
I am using Bootstrap 4 on my web page, which uses the bootstrap grid layout in flex mode.
In one of the columns I have a button that I want to fill the column. This is done by setting the button to 100% height using CSS.
This works without any problem in all browsers except Safari, where it seems to be ignored.
The html I'm using looks like this:
<div class="container">
<div class="row">
<div class="col-10">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis felis turpis. Fusce blandit malesuada dolor, id gravida tortor cursus varius. In vulputate ipsum ut lorem commodo elementum. Cras finibus at mauris vel varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis felis turpis. Fusce blandit malesuada dolor, id gravida tortor cursus varius. In vulputate ipsum ut lorem commodo elementum. Cras finibus at mauris vel varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec quis felis turpis. Fusce blandit malesuada dolor, id gravida tortor cursus varius. In vulputate ipsum ut lorem commodo elementum. Cras finibus at mauris vel varius.
</div>
<div class="col-1">
<button class="btn btn-primary" type="button">Lorem ipsum</button>
</div>
</div>
</div>
In addition to regular bootstrap code I have added the following css:
button { height: 100%; }
Here is an codepen example that shows the issue http://codepen.io/anon/pen/BppMvw
Does anyone have any suggestion on how to solve this? Since the other columns in the row may be of variable hight, it's not possible for me to set a fixed height. Javascript is not an option either.
A solution might be to set flex:1 on the button and make its parent a flex container. See here.
I am using Boostrap 3 for some website I am creating, what i want to make i next.
Here is a code
<section class="container-fluid">
<div class="container">
<div class="row">
<div class="col-md-6"><img class="img-responsive" src=
"http://webdesignledger.com/wp-content/uploads/2009/09/logo_design_4.jpg" /></div>
<div class="col-md-6">
<h2">Lorem ipsum dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean eu sollicitudin felis. Vestibulum vitae imperdiet nibh. Curabitur euismod
auctor libero sit amet varius. Maecenas eu porta libero. Pellentesque et sem et
turpis scelerisque hendrerit vel ac nibh. Nam tempor ullamcorper scelerisque.
Aenean accumsan ac justo ac laoreet. Aliquam eu libero</p>
</div>
</div>
</div>
<section>
Here is working fiddle
http://jsfiddle.net/gSmRw/
On big screen text always to be allign in the middle of the picture, i dont know how big picture will it be, maybe small maybe big, any idea, or help.
Here is picture what i want to make and how it has to look up
http://jsfiddle.net/gSmRw/3/
I've basically added a calss table to the .container element and changed the CSS of this container to be styled as table.
it's important to give the image div wrapper a width of 1% so the cell will not be wider than the image.
I want to affix the following code to the top of the page, below the nav so it is always visible.
<div class="col-lg-5 nopadd affix">
<h3>Project One</h3>
<p>Lorem ipsum dolor ...</p>
</div>
However when I add the bootstrap .affix it makes it ignore the col-lg-5 class that has been applied.
Here is the code I have so far.
http://jsfiddle.net/P9d5k/2/
http://jsfiddle.net/P9d5k/2/embedded/result/
try this fiddle
I just add a 100% width div with the affix class and inside a .container with your grid inside
<div class="affix" style="width:100%;z-index:2">
<div class="container">
<div class="col-lg-5">
<h3>Project One</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae. Sed dui lorem, adipiscing in adipiscing et, interdum nec metus. Mauris ultricies, justo eu convallis placerat, felis enim.</p>
</div>
</div>
</div>