paragraph

Get paragraph text inside an element

倾然丶 夕夏残阳落幕 提交于 2019-12-03 04:17:46
I want to have the text value from a <p> inside a <li> element. html : <ul> <li onclick="myfunction()"> <span></span> <p>This Text</p> </li> </ul> javascript : function myfunction() { var TextInsideLi = [the result of this has to be the text inside the paragraph"]; } How to do this? Alternatively, you can also pass the li element itself to your myfunction function as shown: function myfunction(ctrl) { var TextInsideLi = ctrl.getElementsByTagName('p')[0].innerHTML; } and in your HTML, <li onclick="myfunction(this)"> Do you use jQuery? A good option would be text = $('p').text(); Try this: <li

Wordpress excerpt by second paragraph

痴心易碎 提交于 2019-12-02 09:48:38
How to limit the excerpt length by paragraph, not word/char count? For example, excerpt shows only first two paragraphs, no matter how long the paragraphs are. Thanks in advance. Pieter Goosen Here is a function that keeps HTML tags in tact, adds a "Read More" link at the end of the excerpt and trims the excerpt after the first paragraph. if ( ! function_exists( 'wpse0001_custom_wp_trim_excerpt' ) ) : function wpse0001_custom_wp_trim_excerpt($wpse0001_excerpt) { global $post; $raw_excerpt = $wpse0001_excerpt; if ( '' == $wpse0001_excerpt ) { $wpse0001_excerpt = get_the_content(''); $wpse0001

How to remove space at top of <p> tag / align contained text to top of container?

心已入冬 提交于 2019-12-01 20:42:31
This is undoubtedly a stupid question but i'm having a bad day and it's confusing me! If you view http://jsfiddle.net/E6kGP/1/ then you can see 2 simple divs next to each other each of which contains a p tag each with different font sizes and matching line-heights. There is a small gap between the top of the p container and the top of the contained text which is different depending on the font sizes (and line-heights). This means that the top of the text in each p is not vertically aligned. If the line-heights didn't match the font-sizes then I could understand this but surely if they are the

P text added to html text

若如初见. 提交于 2019-12-01 19:53:24
I know there are a lot of topics on this, and I've already looked at all them and none of the solutions there apply to me. I've put a shortcode to run a jscript for a responsive slider in the 'text' side of my page editor. Yet when I load the page, the source code has tons of paragraph tags after every line of the javascript. It even has a paragraph tag before it even asks for the content itself. I've tried editing the functions.php file of my theme (Reason 2.0), but I'm not sure I could mark it up correctly, it's very php-heavy. I've also tried five of the plugins suggested here. None of them

HTML CSS Responsive paragraph tag

泪湿孤枕 提交于 2019-12-01 13:57:23
I am designing a webpage and I am almost finished but there is a small issue that I can't seem to figure out. HTML: <html> <head> <style> * {margin:0; padding:0; text-indent:0; } .float-box-footer{display:inline-block;position:relative;height:37px;background-color:#accb32;max-width: 860px;width: auto\9;} .p4{font-size: 12pt; color: black; padding-left:5pt; left:0; top:7pt; font-family:National, Arial, sans-serif;position:relative;} .p5{font-size: 7pt; color: black; padding-left:465pt;} </style> </head> <body> <div class='float-box-footer'> <p class="p4">Learn more <a href="http://www.google

Putting a block level <span> element inside a <p> element

不羁岁月 提交于 2019-12-01 10:13:19
问题 I know that <p> is to be used specifically with inline elements. But what if you change an inline element like <span> into a block-level element using { display:block } and contain it within a <p> ? ie. <html> <head> <style> p { background: red; height: 100px; width: 100px; } p span { display: block; background: blue; height: 50px; width: 50px; } </style> </head> <body> <p> <span>I am a pizza</span> </p> </body> </html> Is that just wrong in every sense of the word? I know it is not common

Grep whole paragraphs of a text containing a specific keyword

拥有回忆 提交于 2019-12-01 06:48:44
问题 My goal is to extract the paragraphs of a text that contain a specific keyword. Not just the lines that contain the keyword, but the whole paragraph. The rule imposed on my text files is that every paragraph starts with a certain pattern (e.g. Pa0) which is used throughout the text only in the start of the paragraph. Each paragraph ends with a new line character. For example, imagine I have the following text: Pa0 This is the first paragraph bla bla bla This is another line in the same

HTML - How to have paragraph split into equally wide lines?

限于喜欢 提交于 2019-12-01 05:22:33
This is about basic HTML+CSS page rendering. When a paragraph is too long to fit in one line, it occupies as much space as it can, then wraps, and again and so on. I would like the line wrapping of my webpage to happen so that the resulting lines are as equal as possible. So instead of getting: wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap with a very short last line, I would get: wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap with more balanced lines. This would be useful, for instance, for right-justified quotations that may

HTML - How to have paragraph split into equally wide lines?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 03:17:18
问题 This is about basic HTML+CSS page rendering. When a paragraph is too long to fit in one line, it occupies as much space as it can, then wraps, and again and so on. I would like the line wrapping of my webpage to happen so that the resulting lines are as equal as possible. So instead of getting: wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap with a very short last line, I would get: wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap wrap

Changing spacing between paragraphs and inside of paragraphs

为君一笑 提交于 2019-11-30 20:55:08
I found a similar topic, to this, but I can't find the specific CSS to change in Wordpress. If you go to my homepage Or blog I want to change the spacing within and between paragraphs . Not sure which element I need to modify in my CSS. Found a line-height property for .body , but that doesn't seem to do what I want. Between paragraphs you should set a margin for that element. Between lines within the paragraph you can use line-height . For example: p { line-height: 32px; /* within paragraph */ margin-bottom: 30px; /* between paragraphs */ } 来源: https://stackoverflow.com/questions/41253908