How to force a piece of text to be 'direction ltr' inside a 'direction rtl' paragraph
You can use a unicode directionality marker character just before the +
sign to give the algorithm the hint it needs.
These are:
LTR: 0x200E
RTL: 0x200F
So:
<p id="text">Please call to <span id="phone">+44-123-321</span> for some help</p>
How to avoid a new line with the 'p' tag
Use the display: inline
CSS property.
Ideal: In the stylesheet:
#container p { display: inline }
Bad/Extreme situation: Inline:
<p style="display:inline">...</p>
Can we use any other TAG inside ul along with li?
For your code to be valid you can't put any tag inside a <ul>
other than an <li>
.
You can however, put any block level element inside the <li>
, like so:
<ul>
<li>
<h2>...</h2>
<p>...</p>
<p>...</p>
</li>
</ul>
Should ol/ul be inside p or outside?
The short answer is that ol
elements are not legally allowed inside p
elements.
To see why, let's go to the spec! If you can get comfortable with the HTML spec, it will answer many of your questions and curiosities. You want to know if an ol
can live inside a p
. So…
4.5.1 The
p
element:Categories: Flow content, Palpable content.
Content model: Phrasing content.
4.5.5 The
ol
element:Categories: Flow content.
Content model: Zero or more li and script-supporting elements.
The first part says that p
elements can only contain phrasing content (which are “inline” elements like span
and strong
).
The second part says ol
s are flow content (“block” elements like p
and div
). So they can't be used inside a p
.
ol
s and other flow content
can be used in in some other elements like div
:
4.5.13 The
div
element:Categories: Flow content, Palpable content.
Content model: Flow content.
Related Topics
D3.Js Drawing Geojson Incorrectly
Detect If Browser Tab Has Focus
Download JSON Object as a File from Browser
Es6 Map and Set Complexity, V8 Implementation
How to Access the Request Body When Posting Using Node.Js and Express
Es6/Es2015 Object Destructuring and Changing Target Variable
Using CSS Modules How to Define More Than One Style Name
Is There a Max Number of Arguments JavaScript Functions Can Accept
Cross-Platform, Cross-Browser Way to Play Sound from JavaScript
Setting a Backgroundimage with React Inline Styles
Differencebetween Angular-Route and Angular-Ui-Router
How to Determine the Number of Days in a Month with JavaScript
Angularjs Ng-Click Stoppropagation
Parsing Iso 8601 Date in JavaScript
Current Time Formatting with JavaScript
Meteor.Publish: Publish Collection Which Depends on Other Collection