r/HTML • u/dalekellytoo • Jul 10 '26
<p> is too small for my phone
https://www.dalekelly.org/Headers look well on phone. Prefer not to replace <p> with headers. Style or CSS thoughts? My two CSS files adjust menu for window size and images for window size. Really a CSS beginner. Simple HTML since mid 90's.
5
Upvotes
2
u/petersencb Jul 11 '26
Set your body font-size to 16px or larger with css. Also use viewport meta tag in the head as another comment mentioned
27
u/SamIAre Jul 10 '26
You should never change an HTML tag for its appearance. h1–h6 have specific semantic meanings and using them for stylistic purposes is incorrect HTML. Changing style should ALWAYS be done through CSS. That’s what it’s for: HTML is content and semantic meaning while CSS is presentation and style regardless of meaning.
6
u/frownonline Jul 10 '26
Have you got the viewport meta tag?
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/viewport
1
u/dalekellytoo Jul 13 '26
If you use Google Chrome Web Browser on an iPhone can you click on this link to see if <p> text is larger than default? I have some code in two CSS files for all pages. Works on Chrome, Edge and FireFox on Computer. Not with Chrome on iPhone. Safari Browser works on iPhone. It would take a lot to edit all HTML pages instead of using CSS.
https://www.dalekelly.org/weblog.html#text
5
u/Weekly_Ferret_meal Jul 10 '26 edited Jul 11 '26
I Second what was said by u/SamIAre
When it comes down to text content, h1-h6 are titles with hierarchy.
h1: The main page title... it should be the concept of the content, with one or few words, think of it as the main container. Usually one per page... but not strictly.
For example:
Riding Bicycles
...
h2: Subtitle, where you expand on the theme in one or 2 sentences.
Example:
Riding Bicycles
All terrain tips for the perfect ride. How to choose the perfect gear for every occasion
...
h3 to h6: It tells the browser that this is where you fragment the concept in subdivisions and expand on each smaller group with
<p>blocks of text with explanations on the various subsections. There could be multiple of this as there might be several subsections to the themeLike the following:
Riding Bicycles
All terrain tips for the perfect ride. How to choose the perfect gear for every occasion
On the mountains
<p>In the City
<p>Beach side
<p>Trail Bikes
<p>and so on...
Size is styled and based on what visual hierarchy you want to give to the text, and it depends on the layout. some quotes in
<blockquote>elements could be bigger that an<h4>to grab the attention of the reader from the main flow of the page.Allocating size based on semantic hierarchy is smart but not always the right thing to do visually, so your
<p>block could be equal of some lower header tier.1
u/Team218Web Jul 12 '26
Can clamp is your friend.
1
u/tkgid Jul 12 '26
I would keep using <p> and just do something like:
<p style="font-size:1.5rem">
1
u/brandinobowman Jul 13 '26
Use rem units to define the font size of your paragraph elements, and all other text elements for that matter, and then change your root font size if you need to at different viewport widths.
1
u/[deleted] Jul 11 '26
[removed] — view removed comment