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

Inserting Adobe Font styles-CSS or HTML tags?

Engaged ,
Feb 15, 2019 Feb 15, 2019

Hello. Apologize for the inconvenience. This post was originally posted on Adobe Fonts section, but after 10 days nobody replied, maybe because is not so popular like dreamweaver forum. Anyway, it's related to web design. Here it is.

Hi,

I've downloaded these styles, al based on Skolar Sans.

.regular-paragraph{

font-family: skolar-sans-latin, sans-serif;

font-weight: 400;

font-style: normal;

}

.spanBold{

font-family: skolar-sans-latin, sans-serif;

font-weight: 700;

font-style: normal;

}

.spanItalic{

font-family: skolar-sans-latin, sans-serif;

font-weight: 400;

font-style: italic;

}

------------------------

I have regular, italic and bold. If I want to insert a Bold or an italic word within a paragraph. What is the correct way?

Option 1: using just the html tags

<p class="regular-paragraph">

This is a paragraph with an <strong>important</strong> content for all our <em>premium members</em> only.

</p>

Option 2: using the classes brought from the Adobe Fonts.

<p class="regular-paragraph">

This is a paragraph with an <span class="spanBold">important</span>content for all our <span class="spanItalic">premium members</span>only.

</p>

Opinions, suggestions, workflows, etc, please. Thank U.

2.0K
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 16, 2019 Feb 16, 2019

Either works, using CSS classes gives you the flexibility to make global changes quickly  and can give you more control over the font-weight. If you use fthe strong tag , by default browsers will style the text with:

font-weight: bold

I'm assuming you've embedded the font(s)?

Translate
Community Expert ,
Feb 15, 2019 Feb 15, 2019

IMO

This is fine:

<p class="regular-paragraph">

This is a paragraph with an <strong>important</strong> content for all our <em>premium members</em> only.

</p>

Using classes in span tags would be useful if you say for example wanted to make global changes, for example if you decided to change all italic styled text to bold, you could do it via the style sheet to update your pages globally. Ths seems an unlikely scenario in reality but just using it to demonstrate why you might want to do it that way...

Paul-M - Community Expert
Translate
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
Engaged ,
Feb 15, 2019 Feb 15, 2019

Thank U. However, my concern doesn't go for the semantic issue, but for the correct technical use of the CSS and proper styling. It's about the TRUE TYPE issue.

For your reply, that makes me think that I don't need to download (or activate) bold, italics, etc, because with the <strong> and <em> tags I solve everything. So when I use these tags, the browser will FORCE the regular font to LOOK LIKE "italic" and "strong". Or even so, the browser will look for any class that appears the closest to the "strong" and "em" shows?

But what happen if I really have activated the italic and bold styles? The browser will look find them and render properly if I just type <em> and <strong>? Or...

...Do I really need to POINT to the correct classes declared in the CSS ".spanBold", ".spanItalic" to get a nice and clean rendering of the fonts? Thanks a  lot for your patience.

Translate
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 ,
Feb 16, 2019 Feb 16, 2019
LATEST

Either works, using CSS classes gives you the flexibility to make global changes quickly  and can give you more control over the font-weight. If you use fthe strong tag , by default browsers will style the text with:

font-weight: bold

I'm assuming you've embedded the font(s)?

Paul-M - Community Expert
Translate
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 ,
Feb 15, 2019 Feb 15, 2019

Here's something on semantic markup which might be useful for you to read also: https://codeengineered.com/blog/2013/html5-semantic-diff-bold-strong/

Paul-M - Community Expert
Translate
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