Copy link to clipboard
Copied
Using the latest version of DW on Mac. How can I insert HTML code into the Table code to set the font?
1 Correct answer
You can legally use inline CSS in your HTML5 code but I don't normally do this except for HTML Emails. It's kind of a mess when used in web sites. But if you're using Muse, I don't imagine clean code is your biggest priority.
<table style="font-family:"Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; font-size: 15px; font-variant: small-caps; font-style: oblique; font-weight:bold">
For more Font-family options, consult CSS Font-stack.
CSS Font Stack: Web Safe and Web Font Family with HTML and CSS code.
...Copy link to clipboard
Copied
HTML <font> tags really aren't used for setting the font family anymore, DW now uses CSS for this...
1. Click the CSS button on the left of the Properties Window (Window > Properties or Ctrl + F3 if it's not open)
2. Click in the cell you want to change in Design View (switch to Design if you are in Live)
3. In the Properties window, choose a font-family or type the font you want to use in the Font field/dropdown
This will add inline css (a style attribute) with the font to your <td> tag.
Copy link to clipboard
Copied
I actually need the HTML code, not CSS, because I am using Muse HTML editor to insert a table.
I find creating and editing a table is easier in DW, then I copy the code and paste it into Muse.
So what I really need is the HTML5 code for fonts (family, size, style, etc).
Copy link to clipboard
Copied
The html <font> tag was removed from the HTML5 spec entirely, it's no longer valid to use <font> tags to specify color, family or size.
Using CSS in the style attribute is the HTML code for it, otherwise you would use either a link to an external .css file, or a <style> tag in the <head> of your page.
Copy link to clipboard
Copied
You can legally use inline CSS in your HTML5 code but I don't normally do this except for HTML Emails. It's kind of a mess when used in web sites. But if you're using Muse, I don't imagine clean code is your biggest priority.
<table style="font-family:"Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif; font-size: 15px; font-variant: small-caps; font-style: oblique; font-weight:bold">
For more Font-family options, consult CSS Font-stack.
CSS Font Stack: Web Safe and Web Font Family with HTML and CSS code.
For more on CSS Font Styles, consult W3Schools.
Nancy

