<frameset cols="25%,75%"></frameset> <!-- comma -->
<input type="text" form="first second three" /> <!-- space -->
<input type="file" accept="image/gif, image/jpeg" /> <!-- comma -->
<div class="a b c d"> <!-- space -->
so, In HTML attributes, When to use a comma, and When to use a space
Most of the time it just comes to to learning which one to use for which element.
Essentially, you should consider comma-separation as an AND statement, and a space as an OR statement. In <input type="file" accept="image/gif, image/jpeg" />
, you want the upload to allow both .gif
and .jpeg
files. In <div class="a b c d">
, you want the declaration to apply to any of the classes.
Note that <frameset>
is deprecated in HTML5, so you should avoid using it entirely.
There's no general rule. It depends on the html element/attribute.
Other example:
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With