Main (html tag) containing header - html

I'm confusing. I read diferents opinions about main. The first one says that main (as it's the principal section) could contain header and footer as direct children.
<main>
<header></header>
<section>for the content</section>
</main>
Others says that main can't contain header as direct children, instead use article or section as parent. So the result would be:
<main>
<article>
<header></header>
<section>for the content</section>
</article>
</main>
Currently I have this layout, but I'm confused if It's necessary to add an article or a section to wrapp the header and the content:

Both variants available.
Do what you prefer more, I like first variant.
I am not sure in format of your work. If it is theoretical use: MDN Library
If it is practical, make sure that it is working and readable.
Do not worry as much as you are doing about tags. Every tag ususally worth nothing, only browsers characterise tags. If you want - you can even create your own tag.
For example:
<style>
main-header{display: block;}
heading-large{display:inline; font: 700 1.5em system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; color: #111; margin: 0; padding: 0;}
</style>
<main-header>
<heading-large>
It is working
</heading-large>
</main-header>
But you will need to characterize it in css and there are will be a lot more problems that you will need to solve with going through, but they are miserable for not corporate projects.
main-header{display: block;}
heading-large{display:inline; font: 700 1.5em system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; color: #111; margin: 0; padding: 0;}
<main-header>
<heading-large>
It is working
</heading-large>
</main-header>

Ok after more research it's seems to be ok to use main with header as a direct children.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main
If I understand this, main could be parent of any flow content.
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#flow_content

Related

Certain IDs not being modified in CSS, how do I fix this?

If I assign the ID Test to a section in HTML and modify that in CSS, the text is modified. But, when I change it to an ID like About the CSS no longer works on the text, and it's just normal <p> formatting. How do I fix this?
<section id="About">
<p>We define a Christian as someone who affirms the Nicene Creed</p>
</section>
#About
{
text-align: left;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

font-weight and font-size not working together

Whenever I want to change the font-size of my text, the font-weight seems to revert back to it's default value in what I see on the browser.
When I inspect it, both font-size and font-weight seem to be applied and working fine. Not sure what the issue is. When I disable the font type I have linked below, it seems to be working fine.
The thing is, I have been using the same font below, and this issue just started occurring overnight. No clue what could have changed. Thank you.
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
#element {
font-weight: 700 !important;
font-size: 20px !important;
}
<div style="display: flex; flex-direction: column; width: 40vw; margin-left: 20px;"><div style="font-size: 24px; font-weight: 600;">Sell your clutter</div><div style="font-size: 20px; font-weight: 600;">Athens Locations</div><div style="width: 100%; height: 25vh;">House1</div><div>House2</div></div>
Did you changed or updated the browser that you usually uses ? Take a look at https://github.com/tailwindcss/tailwindcss/issues/1402
Similar thing happened with me. I tried multiple things, then I used Firefox instead of Chrome and it was working fine. Then only I came to know about bug.
Did you check that you're ID's and Classes matched the ones you set up in your HTML page. Either that or your browser might have the issue try updating it to the latest version if you haven't already. Because these days most of the CSS only works on modern browsers.

CSS font-spacing issue with Calibri and the letters "ti"

I'm starting a website build for a small business that uses Calibri as the primary font for their branding and I have come across an issue with using this font in certain web browsers.
In Google Chrome and Opera, the letters "ti" appear to be joined. When I apply some letter-spacing, they will not separate. This doesn't happen in Mozilla Firefox or Microsoft Edge.
Is there an issue with the font, or is it the browser?
Is there anything I can do to fix it?
I've created a snippet for testing (or you can test at https://codepen.io/whitenoise83/pen/KyXWWL)
#site-title {
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif !important;
color: #e00b00;
font-size: 6em;
font-weight: bold;
/*letter-spacing: 0.25em;*/
}
<span id="site-title">Audiomation</span>
You can use font-variant-ligatures: none; in your CSS to prevent the browser using special ligature characters for some combinations of characters/letters.
See also this article: http://www.cssportal.com/css-properties/font-variant-ligatures.php
#site-title {
font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif !important;
font-variant-ligatures: none;
color: #e00b00;
font-size: 6em;
font-weight: bold;
letter-spacing: 0.05em;
}
<span id="site-title">Audiomation</span>
Never seen that but after some search :
Maybe a font ligature option to choose ?
https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures
Hope its help ;)

How to use Google font in wordpress?

My custom css has the following code
h1 a {
font-family:'Droid Sans Mono''Share Tech Mono''Ropa Sans', sans-serif;
'Poiret One''Cutive Mono''Helvetica Neue''Arial'; !important;
}
this is at the top of my custom css:
#import url (http://fonts.googleapis.com/css?family=Roboto|Droid+Sans+Mono|Share+Tech+Mono|Ropa+Sans|Cutive+Mono|Poiret+One|Lato:100,600,900) ;
and my in page code is:
<h1 style="font-size: 25px; font-weight: bold; color: #ffffff; hover font-family:'Droid Sans Mono''Share Tech Mono''Ropa Sans', sans-serif;"><a href="http://www.xxx.com/?page_id=4348"></h1>
But the none of the fonts seem to be loading. What am I doing wrong?
You're loading the CSS in your custom CSS, which is good, but you're not calling it properly.
You have this:
h1 a {
font-family:'Droid Sans Mono''Share Tech Mono''Ropa Sans', sans-serif;
'Poiret One''Cutive Mono''Helvetica Neue''Arial'; !important;
}
Not only is that code wrong, it's scary.
This is what it should be like:
h1 a {
font-family: 'Droid Sans Mono', 'Share Tech Mono', 'Ropa Sans', sans-serif, 'Poiret One', 'Cutive Mono', 'Helvetica Neue', 'Arial' !important;
}
Each new font call should be seperated with a , and the !important goes before the ; and the style will always only have one ; right at the very end of the css style rule.
Also just for the record, there is no good reason you need to include that amount of fonts, and if Droid Sans Mono and Share Tech Mono and even Ropa Sans don't load, anything after sans-serif won't load as sans-serif will be the font of choice as it's a default choice and should only really be used as a last resort/fallback (if you have other fonts you want to take precedence, that is).
If they do load, then you're only going to ever be using Droid Sans Mono and then it's a waste calling all the other fonts.
Make sure you're actually using all of those fonts, as it could essentially slow down the website load time drastically.
Side note:
Please try and refrain from using inline css (css that is put in using the style in a html attribute). However, if you must do it, you need to fix your h1 tag also:
<h1 style="font-size: 25px; font-weight: bold; color: #ffffff; font-family:'Droid Sans Mono', 'Share Tech Mono', 'Ropa Sans', sans-serif;"><a href="http://www.xxx.com/?page_id=4348"></h1>
Don't just include the word hover in there because it will break your CSS and anything after has a high chance of not running. Again, separate each instance of font with a , and have only a ; after each new css style rule.
You don't need both inline css and a css file styling two identical attributes, just use the .css file.
Please make sure that you have url( and not url (. Although it is a simple (space), it is a function and will not work if the ( is not directly after url.
you're not loading the font anywhere. i suggest you install and use this plugin: http://wordpress.org/plugins/wp-google-fonts/
you'll choose the font you want on your website and you will be able to use it.
hope this helps

using 'lighter' weight of a font

I'm trying to use the "Helvetica Light" font, which comes bundled with Helvetica. To do this I read that I had to specify "Helvetica Light" AND font-weight: lighter. I've gotten this to work only by doing this (in SASS):
p
font: "Helvetica Light", Arial, sans-serif
font-size: 12px
font-weight: lighter
and in other instances,
h2.light
font: Helvetica, Arial, sans-serif
font-size: 12px
font-weight: lighter
(or with font-family instead of font)
which is really weird and the only combos that works so far (combining all properties into 'font' doesn't work, and calling the font: as font-family: sometimes doesn't work.
In another rule, I wasn't able to get it to work unless I ONLY had font-weight: lighter with no font specified (but it inherited Helvetica).
Now I copied the exact same font styles as the p and put it in an h4 and it no longer works. Wtf? What am I doing wrong/why is this so buggy?
EDIT: THIS IS NOT A SYNTAX PROBLEM. To the answers below, note that I am using SASS. No semicolons and brackets needed. Also the file I am editing is 5k lines long (a hand me down) and grouped into somewhat organized sections. So I'd like to keep the sections intact until I can refactor it, but then I can't group all the p's and h2.lights together since they are in different sections.
Thanks!
Try this.
p
font: 'Helvetica Light', 'Helvetica', Arial, sans-serif
font-size: 12px
font-weight: 100
Just for reference, lighter works relative to the inherited value. It's better to use absolute values.
http://www.w3.org/TR/CSS2/fonts.html#font-boldness
what finally worked for me was to have font-family as Helvetica, and font-weight as lighter (but not the condensed format, which doesn't work).
Note: this answer was written before the OP specified SASS. It applies to CSS only.
A couple of things you should do to clean this up:
Semi-colons
All your CSS rules should end with a semi-colon, such as font-weight:lighter;
Grouping
As you have 2 identical CSS rules, the fastest and most concise way to do it is this:
p,
h2.light,
other_rules {
font: Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: lighter;
}
Then for the one rule where you want a different font,
p{ font: "Helvetica Light", Arial, sans-serif; }
Be sure to put your exceptions below the general rules (i.e. in the order I've shown you here) because CSS is implemented in order, and a rule further down the document will take priority.
Try this:
p, h2.light
font: "Helvetica Light", Arial, sans-serif
font-size: 12px
font-weight: lighter
inheritance, establish a base metric typography, so device doesn't crack-up style intersections
body[role="put something here"] h1, p, etc
font-size: 62.5%
Helvetica light, mix with unix-mac-windows-webfont (webfont needs js, may pull you up over edge
font-family
Helvetica Light, Helveticaneue Light, Calibri Light, Helveticaneue, Helvetica, Gill Sans, Myriad Pro, Arial, Lucida Grande, sans-serif
degrade per Meyer, or try just 2 hl, ss... also, check out your mixin
https://github.com/less/less.js/issues/389
Sass for Web Designers by Dan Cedarholm and Chris Coyier