HTML #5: HTML Tags, CSS Functions, and Inline CSS

+2

HTML #5: HTML Tags, CSS Functions, and Inline CSS

CSS is complicated, and with the right understanding, you can make amazing animations and creative text. But it is also a privilege to use on JetPunk. Today, learn how to use CSS selectors and codes, but responsibly. @Malkiboy let me add on to his great series!

*The "selectors" are actually HTML tags*


Selectors


Below, the functions of some different selectors will be shown:

<p>TEXT</p> - The most well known CSS selector, this allows you to make separate paragraphs, like on this blog for instance.

<b>TEXT</b> - Another well known selector, this will bold the text put inside. Just remember that with any CSS code, end with the "/" (slash) before the letter(s).

<u>TEXT</u> - This selector underlines the text. It is used often to emphasize a word within a caveat or instructions in quizzes.

<s>TEXT</s> - While not as important as the others, this selector is often used in blogs or funny comments. It puts a strike in the middle of the text inside.

<i>TEXT</i> - Although rarely used on JetPunk, this selector can also be used to emphasize words or even to show thoughts (I would look forward to seeing it on JetPunk stories in the future). It italicizes the text inside.

<a>TEXT</a> - I feel like I'm the only person who uses this code alone. It is the HTML tag for how a hyperlink underlines when hovered over and is naturally blue. You can trick your friends by adding this tag to text without using a URL. They will be confused why nothing is happening.

Combined Selectors - This isn't really a new code, but you can add different styles to the same line of text. Just place a separate selector where the text would go inside of another selector. For example, to underline and bold text, use this code:

<u><b>TEXT</b></u>

ABUSIVE:<h1>TEXT</h1> - This selector is used for the title of a JetPunk page. It can be accessed anywhere on the page. However, messing with this will harm JetPunk because specialized AI count this as CSS abuse, and so will JetPunk because the rating will go down. I actually wish JetPunk would remove this feature from users.


Styling


Styling isn't as complex as most think, and there are many different functions. In case you don't know what it is, basically it can alter text more than selectors can, including within a selector. It is incredibly useful for increasing the font size on let's say, this blog.

In order to use styling, you must add the word style after you define the selector, but only in the first pair of <> and before the >. The inline CSS (see Internal Versus Inline CSS) for this subtitle is as follows:

<p style="font-size:23px"><b>Styling</b>

The code "font-size" can be used to increase or decrease the default font size. Just remember to include "px" after the number! Below are some other CSS functions:

opacity - This will change the transparency or the see-through in the text. After the colon, place a percentage in which you want the transparency to be set at (e.g. opacity:60%).

text-align - The "text-align" function simply changes where the text will appear on the page. Some options are left, right, or center (I used center at the top of the page for the heading at the top).

color and background-color - Color simply changes the color of the text. Some simple colors that you can type are blue, light gray, white, black, green, etc. Some more complicated ones that turn out very well are dodgerblue and mediumseagreen. If you want to include RGB or HEX colors, simply use the # after color: (I'm not going to explain those colors). Because the colors are exactly the same for both, if I told you that "background-color" simply changes the background color, I bet you can imagine what to do.

border - The border function is a nice command, because there are so many different ways to style border around a text with it. It is a bit more complicated however, as you must add spaces in between three definitions. First definition: border size - just use the same thing as text size with the number and px. Second definition: after adding a space, the second definition is just the color. Third definition: after adding a second space, simply say what type of border to use. Solid is a basic border, while double and ridge are a bit different but can look amazing. After you are done, your code should look somewhat like this:

<p style="border:5px mediumseagreen ridge">TEX</p>


Internal Versus Inline CSS


This whole time, I have been showing you a type of CSS coding called inline. In inline coding, you must define the styling for the selector every time. The reason I haven't showed you internal, is that internal requires you to make several different variables (e.g p1, p2, p3) and then define each variable as a selector once. So for example, I can use just

to create my subtitles. However, this often messes with the comments, and everything starts to get crazy.

Using internal CSS defines the whole entire page, so if you tried to edit a hyperlink every drop down menu on the page would have the coding on it. It also can be marked as abuse as the comments with crazy alterations will trigger the system.

To be honest, just use inline.


This is my longest blog yet, it took much formatting and detail. Please give feedback and tell me if you learned something!

Edit: If you want to add a horizontal line to a blog, just use the code <hr/>.

51 Comments
+2
Level 65
Feb 3, 2021
Now, for borders this design looks absolutely insane:

<b style="border:5px mediumseagreen ridge">This is a new blog</b>

Result: This is a new blog

+2
Level 65
Feb 4, 2021
I found the best text combination:

<b><u><i style="color:orange;opacity:70%;border:5px dodgerblue outset">TEXT</i></u></b> Result :

TEXT

+3
Level 51
Feb 3, 2021
I wish I could "star" this blog to go back to it when I want
+1
Level 65
Feb 3, 2021
That would be a cool feature! Glad it's informative!
+1
Level 51
Feb 3, 2021
:)
+1
Level 34
Feb 3, 2021
Does this work for me?
+1
Level 34
Feb 3, 2021
It does!
+1
Level 60
Feb 6, 2021
I wanna try it!!!
+1
Level 52
Feb 3, 2021
You could bookmark it, if that's better.
+1
Level 51
Feb 3, 2021
oh that could help! Thanks GrandOldMan
+2
Level 59
Feb 3, 2021
nice, thank you for the tips to get started with css
+1
Level 65
Feb 3, 2021
Your welcome :)
+3
Level 59
Feb 3, 2021
good! similar to my html blogs, but this is better!!
+1
Level 59
Feb 3, 2021
also i'm really glad you introduced inline CSS in this blog!
+1
Level 65
Feb 3, 2021
Thanks, but I think your's is better.
+1
Level 65
Feb 3, 2021
Okay. Can I change the title to fit the series?
+5
Level 68
Feb 3, 2021
Great blog!

One little nitpick though, what you describe as "selectors" are not selectors, these are just HTML tags. Selectors can be anything from tags, ids, classes and attributes, and are what is used in "internal" CSS to select parts of the page. E.g. doing "#path222.class + p[name="text"]" is an example of a selector used. See CSS Selectors for more detail on selectors themselves. However, as you mention, this is not useful for JetPunk as it's safer to use inline styles.

+1
Level 65
Feb 3, 2021
Okay. Glad to know.
+1
Level 68
Apr 6, 2021
Maybe change selectors to tags in the blog so that it will not confuse more people reading it?
+1
Level 65
Apr 6, 2021
No, the HTML used to show the arrows without activating code always changes to the arrows every time I edit it, so this blog is very difficult to make changes to.
+1
Level 43
Feb 3, 2021
Very nice! I know the HTML. I type with eyes closed! LOL! But CSS looks nice! After I will read and try!
+1
Level 65
Feb 3, 2021
You didn't put the hyperlink CSS :P
+1
Level 65
Feb 3, 2021
Yes, I know. But Fuse's blog is huge on that. Also, I did say some for a reason. I'm going to show you guys how to do a joke with HTML tags next.
+1
Level 14
Feb 10, 2021
here is hyperlink CSS:

<.a href="url">text<./a>

+1
Level 14
Feb 10, 2021
Remove every single full stop. I had to add the full stops otherwise the codes would disappear and turn into a hyperlink which led to a 404 file not found error page.
+1
Level 14
Feb 10, 2021
+1
Level 14
Feb 10, 2021
Aw come on, it did not turn into mediumseagreen
+1
Level 37
Feb 3, 2021
thanks for this blog!
+1
Level 65
Feb 3, 2021
:&)
+1
Level 42
Feb 3, 2021
I learned web design and didnt know I can use it here

This is amazing

+1
Level 54
Feb 4, 2021
Nice, I think this will good if someone want HTML colour names
+1
Level 14
Feb 7, 2021
ngl my favorite are MediumSpringGreen MediumAquaMarine and Lime
+1
Level 43
Feb 4, 2021
Very nice!

I liked to much this “class” LOL!

+1
Level 60
Feb 6, 2021
Let me try that!
+2
Level 59
Feb 7, 2021
his should be html #4, I think
+1
Level 60
Feb 7, 2021
By the way here is JetPunk.com.
+1
Level 14
Feb 7, 2021
Nice try... I figured out that it was a joke before I even pressed it!
+2
Level 55
Feb 7, 2021
Nice!
+2
Level 60
Feb 8, 2021
I like this!
+1
Level 51
Feb 19, 2021
Just so you know you can also do < h r > (Without the spaces) to do a horizontal line (Same thing just without the slash)
+2
Level 66
Mar 11, 2021
cool blog
+1
Level 65
Mar 11, 2021
Thanks :). To do superscripts, just do this:

hi<sup>hello</sup>

Result:

hihello

+1
Level 59
Mar 11, 2021
to do subscripts do this hi<sub>hello</sub>

result-

hihello

+1
Level 51
Mar 22, 2021
co2
+2
Level 66
May 7, 2021
hiholaciaonamasteni haobonjourkonichiwaguten tagahlankumusta
+1
Level 51
Mar 11, 2021
and sub
+1
Level 51
Mar 11, 2021
I am very disappointed that the < input type="date"> does not work here
+1
Level 42
Apr 13, 2021
< i style= border: 6.1px golf green Columns: 3< I like it/u> Result:
+1
Level 42
Apr 13, 2021
+1
Level 42
May 25, 2021
It's cool Result :
+1
Level 42
May 25, 2021
Your< sup > great < sup> at blogging . Why aren't you making more