+ 16
How can I change the font-size and font-weight of two words in same paragraph
22 odpowiedzi
+ 2
In your html file
<p>
<div class ="first">first style</div>
<div class="second">second style</div>
In your css file
.first{
Font-size:50px;
}
.second{
Font-size:30px;
}
+ 20
Add span tag within the words in the same paragraph. style that span class.
+ 9
Use Css
Wait a min
say
In html
<p><div class ="Hello">Hello</div><div class="hye">Hye</div>
In css
.Hello{
Font-size:10px;
}
.hye{
Font-size:15px;
}
You can try
All The best for your Future Codes.
+ 8
Using CSS.
+ 5
You can add Id or class attribute for the particular words within p tag...and after that style them using CSS.
Hope it helps!
+ 4
U can use style attribute- <img style="border:2px solid;" src="photo.jpg">
+ 2
You can do this without CSS also with <h> tags to control size and <b> or <strong> for font-weight
https://www.w3schools.com/html/html_formatting.asp
+ 2
You can do that with <span> element
for example:
html
<p>I like <span class="twowords">Solo Learn<span><p>
css
span.twowords{
color: blue;
font-size: 18px;
}
+ 1
Like its been answered earlier, just a working example here:
<p>Here <span style:font-size:5px;font-weight:bold;>is<\span> the <span classSelector>paragraph<\span><\p>
+ 1
In my opinion the best soultion would be warpping the two words with span tag and then style the span in css
Edit: you can also use inline css in the paragraph
+ 1
Use CSS instead of trying strong or bold as you'll have better control over the style using CSS. Checkout the CSS course in sololearn.
+ 1
Sophia
Thanks for sharing, but you should use <span> in the paragraph element instead of <div>. That way you won't have a line break in the paragraph and the <p> element will be properly closed. We generally use div as a container for styling many elements at once. So if you add style to the div, then all elements in the div will gain the divs properties.
<style>.bg-green{background-color:green;
}
.Hello{
font-size:10px;
}
.hye{
font-weight:bold;
font-size:15px;
}
</style>
<div class="bg-green">
<p><span class ="Hello">Hello</span><span class="hye"> Hye</span></p>
</div>
0
How can i set border for image usin html alone
0
Tout Can use thèse balise br
0
you can use any of the css selectors.
0
Kratika Soni you can use style for that part or use can make use of div : class or heading tags also
0
You can use any of the following way:
1. You can use span tag with style property for those 2 words. For e.g. <span style="font-size:20px; font-weight:bold;"></span>
2. You can assign class or id for those two words and with css you can apply styling. For e.g. <span id="title"></span> and then apply css as
#title{ font-size:20px; font-weight:bold;}
You can use class as well in the same way.
3. Or you can also make use of header tags and bold tag if it is convenient. But the above two options are more customizable.
0
Write the code as shown below
HTML:
<p>This is a <span class="font-size">beautiful</span> <span class="font-weight">flower</span></p>
CSS:
.font-size { font-size: 20px; }
.font-weight { font-weight: bold; (you can write the value as needed) }
Hope It Will Help
Thank you
- 1
You can use Strong or bold function in HTML
- 1
Using CSS code for example .p{.....}