This question already has answers here:
Indent starting from the second line of a paragraph with CSS
(6 answers)
Closed 4 years ago.
i want to show second line of wrap text with space .
OUTPUT:
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took
EXPECTED OUTPUT:
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took
my code:
<style>p{
overflow:word-wrap;
}</style>
<p> Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took</p>
Thanks in advance.
This is pretty easy to handle. The trick is to add a little padding, and then actually "indent" the first line with a negative value. Sort of thinking outside the box.
p {
padding-left: 2em;
text-indent:-2em;
}
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took
</p>
Related
I'm trying to add a paragraph to a long text. Already tried using tags like "\n", "\\n" and "\\r", but it's useless. Here's my string:
{
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."
}
Can't believe I've not been able to add a simple linebreak yet. Anyone, please?
I have a span tag with inner html like this
In my html :
<span [innerHTML]="description"></span>
and in my ts:
description = "some random text https://stackoverflow.com/ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
It displays the link but when I click on that link it is opening in the same tab but I want it be opened in a new tab.
Is there any way to do this?
In this case that you are using innerHtml property binding you can place a html link in your description text with target="_blank" to open the link in a new tab:
description =
'some random text https://stackoverflow.com/ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s';
Hello and thanks for looking into my issue, I am currently working with an XML file that is being pulled to create a directory list. What I am trying to achieve here is to display an image next to the person's name but it seems like no matter how I link it the image it doesn't display on the browser.
I have tried to add the image as ,
<profile>
<lastname>Sample Last name</lastname>
<firstname>Sample First name</firstname>
<middlename></middlename>
<lastfirstname>First_Last</lastfirstname>
<indextitle><![CDATA[Dean]]></indextitle>
<photo>photo.jpg</photo>
<bio>
<![CDATA[<p>Lorem Ipsum is simply dummied text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>]]>
</bio>
</profile>
Css of:
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown</p>
Style will be different compare to text have just one line:
<p>Lorem Ipsum is simply dummy text</p>
Is it possible?
Thank you so much :)
Did you want the line inside the paragraph to have a different style if so you can just add a span with an id to the area you want with a different style.
#line{
font-weight: bold;
}
<p><span id="line">Lorem Ipsum is simply dummy text</span> of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown</p>
If you are looking to target a single vs multiline sentence in CSS, this is not possible.
If you want to restrict your <p> to just one line use white-space: nowrap;.
Short answer is no. The length of the actual text in a paragraph doesn't effect the style of it.
However if you assign the paragraph tags within classes or id's then you can set each individual class or id to unique styles within the css style sheet.
You would have to do this programmatically with JavaScript.
Find the paragraph elements, check the length of the content and then apply a style based on that.
Here's a jsfiddle to illustrate (with jQuery).
HTML
<p>A short line.</p>
<p>A longer line with more words in it.</p>
JS
$("document").ready(function() {
$("p").each(function() {
if($(this).text().length > 15) {
$(this).css("color", "red");
}
});
});
I have a huge XML file with multiple blockquotes code sections like this:
<blockquote>lorem Lorem Ipsum<i> is simply dummy text</i> of the printing and typesetting industry. "Lorem Ipsum has been the industry's standard dummy text" ever since the <b>1500s</b>, when an unknown printer <i>took a galley</i> of type and scrambled it to make a type specimen booki>
I need to select all the blockquote and content inside blockquote tags in order to remove and clean unnecessary tags like:
<i>, <em>, </em>, </p>, </i>, <b>, </b>, <strong>, </strong> and " inside the text.
End results:
<blockquote>lorem Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book</blockquote>