I would like to html code part of my tumblr page, but in the context, I can't add any css. Is there any way to format text size, font, color, etc. without using css? I looked at <font>
tags but they don't seem to be supported in html5. Is there a workaround or tag that would do this for me?
Thanks for all your help
That is the easiest way and by doing so the code is in all one place, inside the head of the HTML file in a style tag, and can be edited easily. FYI Javascript functions can be added by placing them inside a '<script >alert("Hi , I'm in javascript");</script>' tag like above HTML code shows.
How to Change Font Type in HTML. To change font type purely with HTML, use the CSS font-family property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.
With HTML alone, without any CSS, you can set
<font face=...>
<font size=...>
(though just to a few values)<font color=...>
<i>
<b>
<sup>
<sub>
<u>
<br>
<wbr>
­
<nobr>
align
attribute or (for vertical alignment) valign
attributebgcolor
and background
attributes in body
element and in table-related elements<marquee>
and some other formatting tools (it is somewhat debatable what belongs to text formatting).
Although HTML5 drafts declare many of these as “obsolete” and “nonconforming”, they also require or strongly recommend (depending on element) that browsers continue supporting them, with the exception of nobr
(which is well supported by browsers, with no signs of getting dropped).
(HTML5 is a draft specification. It does not “support” anything; browsers do. Specifications may require support, but that’s just a normative statement, about how things should be.)
If you can in fact use CSS at least in style
attributes, then there are many more possibilities, though styling is then clumsy and limited.
CSS in a separate file may not be the answer but you may be able to include it in the head of the HTML file like so:
<doctype HTML>
<html>
<head> <title>My title</title>
<style>h1{
color:red;
font-size:20px;
}
</style>
</head>
<body><h1>My large text heading</h1>
<script>alert("Hi , I'm in javascript inside the HTML File");</script>
</body>
</html>
That is the easiest way and by doing so the code is in all one place, inside the head of the HTML file in a style tag, and can be edited easily. FYI Javascript functions can be added by placing them inside a '<script >alert("Hi , I'm in javascript");</script>' tag like above HTML code shows.
Add CSS as a style directly to the tag you want to format.
EX.
<p style="width:20px;height:20px;background-color:#ffcc00;">The contents go here</p>
You can also add <a href="thepagelink.html" style="text-decoration:none;"></a>
This would remove the underline and any formatting on the link. You can then also add your own styling e.g <a href="thepagelink.html" style="text-decoration:none;" style="color: #07781C;"></a>
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