+ 1
Is it possible that elements between CSS3 can also be styled?
10 Respostas
+ 6
Shouldn't all content on a web page including the example text between paragraphs be marked up with semantic, (descriptive and meaningful) HTML elements in the first place? and secondly, yes, because that also simplifies and clarifies styles?
+ 6
harsh vardhan tripathi to complement what David Carroll and Lisa F said it is bad practice to write text outside html elements, and your code will look messy too, plus it will be much harder to style your document without proper structure. Best practice is to put every text in the proper elements.
HTML 5 added new elements to help you, you can read more here;
https://www.w3schools.com/html/html5_semantic_elements.asp
+ 6
Robin R. and Lisa F
Indeed... The example Ipang used to better understand the question is one that would qualify as highly unusual and certainly considered to be bad practice.
The issue with that example is the free text is adjacent to block elements containing a similar structure of text. In this case, there really isn't any reason for the free text to NOT be wrapped within a semantic block element as well.
On the other hand, had the example used inline elements, this would qualify as a valid and quite common use case.
Examples would be when using <strong>, <em>, <a>, <span>, <img>, etc.
You really
<strong>can't</strong>
escape this mixing of
<a href="#">
<span>
<em>content</em>
types
</span>
</a>.
In this context, there wouldn't be anything wrong with this question. đ
+ 5
harsh vardhan tripathi The non-element text between its sibling <p> tags are technically wrapped within a parent element.
Therefore, all non-element text will be styled according to the styles applied to their parent element.
However, be aware that the same styles applied to the parent element will, by default, cascade to all child elements, which will include the sibling <p> tags.
Therefore, if a specific style should only apply to the non-element text in between, that text should be wrapped in its own element.
+ 3
<p>This is paragraph 1</p>
This text lies in between two paragraphs
<p>This is paragraph 2</p>
You mean you want to style the "This text lies in between two paragraphs" part?
+ 2
What exactly do you mean? Example?
+ 1
Not really sure, but AFAIK you will need to wrap it in something, like a <span> or <div> or something. It's the text container (span, div) whom will be styled eventually.
0
I mean, can we style between text of paragraphs by css3
0
Yes exactly
0
The background-clip property defines how the background of an item (whether image or color) extends under the border box, the padding box, or the content box