• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Changing font size

New Here ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

I have CS6, how to I set the font size for a single sentence?

Views

210

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

the easiest way is to add a specific calss to this sentence... but first there are two contexts...

 

Context 1... you want to apply the font size to the all TAG

so lets say that you have you sentence that way (I use a P TAG, but it could be any TAG

<p>The sentence</p>

you create and add a class to this TAG that way

<p class="myclass">The sentence</p>

 

Context 2... you want to apply a different font size in the middle of a TAG and focus on some words only

so you will have to add a SPAN TAG containing the class, that way

 

<p>The <span class="myclass">sentence</span></p>

 

 

 

now, in both context, you have to declare the class in a CSS sheet, or the STYLE TAG in the header of the HTML document

problem wit this latter solution is that this CSS class will be available only in this document and not in your entire web site.

So let's go for instance in this limited solution

go in between the HEAD TAG in the top of your document and add the following code

<style>
    .myclass {
        font-size:36px;
    }
</style>

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

Hi Birnou,
Thank you.
When I add a <p> to the page it puts too much blank space before the <p>.
Can I change the amount of space before the <p>or can I use your suggestions somehow without the <p>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

quote


When I add a <p> to the page it puts too much blank space before the <p>.
Can I change the amount of space before the <p>or can I use your suggestions somehow without the <p>


By @Harrirt0D44

 

Use margin/padding to control the spacing:

 

<p class="myClass">Some text goes here</p>

 

Css - 0px 0px 0px 0px - Top/Right/Bottom/Left (You dont technically need to include the measurement, in the example case 'px' IF set to 0 BUT include the measurement IF the value is more than zero, example - 10px 15px 10px 15px etc.

 

Set the css for '.myClass' in your css stylesheet IF you have one attached to your page:

 

.myClass {

margin: 0px 0px 0px 0px;

padding: 0px 0px 0px 0px;

}

 

OR wrap the '.myClass' css selector in <style> tags and insert in the block of code in the <head></head> section of your pages code:

 

<style>

.myClass {

margin: 0px 0px 0px 0px;

padding: 0px 0px 0px 0px;

}

</style>

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

@Harrirt0D44,

Add this to your cascading stylesheet or CSS file.

 

p {

margin:0;

padding:0;

font-size: 1rem;

line-height: 1;

}

 

.large {font-size: 2rem; line-height: 2}  /**adjust values as needed**/

 

HTML:

<p>This paragraph is normal size.</p>

<p class="large">This paragraph is large size.</p>

 

Hope that helps.

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

quoteWhen I add a <p> to the page it puts too much blank space before the <p>.
Can I change the amount of space before the <p>or can I use your suggestions somehow without the <p>
By @Harrirt0D44

 

hello @Harrirt0D44 

 

well in HTML there are two types of TAG... the bloc TAG and the inline TAG...

The P TAG is a bloc type. So it means that it has rules for being positionned

https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block

 

beside the bloc type of TAGs, there is CSS rules that control the display.

and among all the CSS properties, there is the DISPLAY one which can affect the way the positionning is handled

https://developer.mozilla.org/en-US/docs/Web/CSS/display

 

now in an other side the P TAG is used to define a paragraph... but your sentence, can be many type of TAG... BLOCKQUOTE, P (to name a few, but there is not so much anyway) which are bloc TYPE, and ABBR, EM, STRONG... which are inline TYPE

 

you can have access to all the HTML TAG available , and how to use them http://w3c.github.io/html-reference/elements.html#elements

(this reference is not well updated... i.e PICTURE is missing, but I really like the way the tree and hyperlinks are done)... here is more updated one... less easy to ready anyway... https://html.spec.whatwg.org/multipage/#toc-semantics - chapter 4.4 Grouping content and chapter 4.5 Text-level semantics

this one is fine to help you choose the appropriate TAG for your sentence - https://html.spec.whatwg.org/multipage/text-level-semantics.html#usage-summary

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2021 Oct 29, 2021

Copy link to clipboard

Copied

All the replies address changing the font size in HTML, isn't it possible to change the font side in Design mode?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 29, 2021 Oct 29, 2021

Copy link to clipboard

Copied

LATEST

Learn to work with code.  It's much faster than Design Panels.

 

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines