A speech bubble enclosing an ellipsis Thread: HTML Formatting guide

Posted by MisspelledFox
6 months ago (edited 5 months ago )

HTML Formatting guide

I learned how to make a few thingies while trying to remember what little HTML i learned ages ago so I figured it'd be useful to leave these here so other people can use them in their own code.

Edit: Make sure to check out The official site's HTML and CSS classes for cool animations (including backflips), cute tooltips, pre-formatted badges in all of the site's official colors, etc!! surprise emojiheart emoji

Last added:

  • Added dropdown menus with links

! emojiDecember 8 Edit: I wanna add more stuff here but I don't know what people would find useful! If you have any suggestions please let me know :D


Buttons (Ready to use!)


Click me to see all buttons!
They're clickable and you can customize the link!

I'm a button

<a href="URLHERE"> <span style="background-color: #D04721; color: #FFE6C0; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>

I'm a button

<a href="URLHERE"> <span style="background-color: #FFC860; color: #4E3B31; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #B1C879; color: #004D00; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #3EA56C; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #22666E; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #27273F; color: #90EE90; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #0B0F48; color: #ADD8E6; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #4268AC; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #9DD8E0; color: #00008B; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #257F90; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #5B2E71; color: #E6E6FA; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #9C58A7; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #C3A5D2; color: #4B0082; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #FFFFFF; color: #70535A; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #BFA3A9; color: #3B2B2B; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #70535A; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #3D3A46; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #161616; color: #D3D3D3; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #491D2D; color: #F5F5DC; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #734340; color: #FFF8DC; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #A07656; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #CF9A68; color: #2C0400; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #E1B58F; color: #9B2F35; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #EA97BB; color: #812653; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #C04B84; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #812653; color: #FFD8E9; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #2E0023; color: #EA97BB; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #590826; color: #CFACB9; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #8D000C; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #BA2F3A; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #CC4430; color: #F6D1A0; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>



I'm a button

<a href="URLHERE"> <span style="background-color: #E73F27; color: #FFC860; padding: 5px 10px; border-radius: 5px;">BUTTON NAME HERE</span> </a>




Badges (Ready to use!)


Click me to see all badges!
They're not clickable, but they're pretty!

I'm a badge

<span style="background-color: #D04721; color: #FFE6C0; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>

I'm a badge

<span style="background-color: #FFC860; color: #4E3B31; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #B1C879; color: #004D00; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #3EA56C; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #22666E; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #27273F; color: #90EE90; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #0B0F48; color: #ADD8E6; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #4268AC; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #9DD8E0; color: #00008B; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #257F90; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #5B2E71; color: #E6E6FA; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #9C58A7; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #C3A5D2; color: #4B0082; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #FFFFFF; color: #70535A; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #BFA3A9; color: #3B2B2B; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #70535A; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #3D3A46; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #161616; color: #D3D3D3; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #491D2D; color: #F5F5DC; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #734340; color: #FFF8DC; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #C9B9AB; color: #5E4330; padding: 5px 10px; border-radius: 5px;">BADGE NAME HERE</span>



I'm a badge

<span style="background-color: #A07656; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #CF9A68; color: #2C0400; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #E1B58F; color: #9B2F35; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #EA97BB; color: #812653; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #C04B84; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #812653; color: #FFD8E9; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #2E0023; color: #EA97BB; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #590826; color: #CFACB9; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #8D000C; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #BA2F3A; color: #FFFFFF; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #CC4430; color: #F6D1A0; padding: 5px 10px; border-radius: 5px;">Badge name here</span>



I'm a badge

<span style="background-color: #E73F27; color: #FFC860; padding: 5px 10px; border-radius: 5px;">Badge name here</span>




Different image sizes


Click me to see how to make images smaller
Includes examples of what different image sizes look like!



You can adjust the size of the image by changing the number in "max-height: 100px; ;"! Here's what some image sizes look like smile emoji

Note: Using fixed image heights and widths may cause distortion when viewed on mobile. While definitely usable, "max-height" (without max width as it causes the same issue) appears to be the safest way to make sure the image doesn't look weirdly stretched out when viewed on a narrow screen.

Size Image HTML Code
100px
 <img src="Your picture's link here!" style="max-height: 100px; border-radius: 50%;"> 
150px
 <img src="Your picture's link here!" style="max-height: 150px; border-radius: 50%;"> 
200px
 <img src="Your picture's link here!" style="max-height: 200px; border-radius: 50%;"> 
250px
 <img src="Your picture's link here!" style="max-height: 250px; border-radius: 50%;"> 
300px
 <img src="Your picture's link here!" style="max-height: 300px; border-radius: 50%;"> 

Round borders


Click me to see how to make images rounder OR less round
Includes examples of what different values look like!



You can adjust the radius of the rounded borders by changing the % in "border-radius: 50%;"! Here's what some other %'s look like smile emoji


% Image HTML Code
200px - 40% Borders
 <img src="Your picture's link here!" style="max-height: 200px; border-radius: 40%;"> 
200px - 30% Borders
 <img src="Your picture's link here!" style="max-height: 200px; border-radius: 30%;"> 
200px - 20% Borders
 <img src="Your picture's link here!" style="max-height: 200px; border-radius: 20%;"> 
200px - 10% Borders
 <img src="Your picture's link here!" style="max-height: 200px; border-radius: 10%;"> 

Change Text Color and Size


Click me to learn how to customize text color and size!
Includes examples of what different styles look like



You can adjust the text color and size using the "color" and "font-size" properties. You can just use a color name (blue, white, black, etc), or you can use specific hex codes. Here's what some different combinations look like smile emoji


Style Text Sample HTML Code
White Text - 20px This is white text at 20px!
 <span style="color: white; font-size: 20px;">This is white text at 20px!</span> 
Hex Color #FFC860 - 25px This is FFC860 text at 25px!
 <span style="color: #FFC860; font-size: 25px;">This is FFC860 text at 25px!</span> 
Hex Color #E37944 - 30px This is E37944 text at 30px!
 <span style="color: #E37944; font-size: 30px;">This is E37944 text at 30px!</span> 
Hex Color #2C0400 - 18px This is 2C0400 text at 18px!
 <span style="color: #2C0400; font-size: 18px;">This is 2C0400 text at 18px!</span> 

Create Badges/Buttons with Background Colors and Rounded Borders


Click me to learn how to make your own badges and buttons!
Includes examples of different styles!



You can add background colors to your text elements and combine them with rounded borders to create the illusion of badges.


To turn these into functional buttons, wrap the badge in an <a> tag to create a hyperlink. Here’s an example:

Grab a trade status template here!

<a href="https://chicken.pet/forums/creative-corner/115" title="This link will take you to my other template thread! πŸ’›"> <span style="background-color: #F0CD35; color: #AB0000; padding: 5px 10px; border-radius: 5px;">Grab a trade status template here!</span></a>



Here's the basic structure to use the <a> tag

<a href="URL">Link Text</a>



Style Badge/Button Sample HTML Code
Black Badge
I'm a badge
 <span style="background-color: #161616; color: #D3D3D3; padding: 8px 12px; border-radius: 8px;">BADGE NAME HERE</span> 
Wine Badge
I'm a badge
 <span style="background-color: #491D2D; color: #F5F5DC; padding: 10px 15px; border-radius: 12px;">BADGE NAME HERE</span> 
Coffee Badge
I'm a badge
 <span style="background-color: #734340; color: #FFF8DC; padding: 6px 10px; border-radius: 5px;">BADGE NAME HERE</span> 

Gradients


Click me to learn how to do gradient backgrounds!
Includes an unpleasant gradient.



You can actually have gradient backgrounds too! I haven't used them much myself yet because I haven't figured out how I'd want to integrate them yet, but it doesn't mean you can't do it first smile emoji

Here's the structure!

background: linear-gradient(direction, color1, color2, ...);


Here's what you can customize

- Direction: You can specify the direction of the gradient (e.g., to right, to bottom, or by angles like 135deg).
- Colors: You can use color names just like before, hex codes, or even RGB values to specify the colors.

Example of a Linear Gradient:

background: linear-gradient(to right, #7B2F91, #4E4C9D);

This creates a gradient that transitions from purple to blue.

Example Usage:

<div style="background: linear-gradient(to right, #7B2F91, #4E4C9D); color: white; padding: 20px;">This is a gradient background!</div>

This creates a section with a gradient background and white text:

This is a gradient background!



Example Badge (with gradient):

Gradient Badge

<span style="background: linear-gradient(135deg, #7B2F91, #4E4C9D); color: white; padding: 10px 20px; border-radius: 5px;">Gradient Badge</span>


Example Badge (with unpleasant gradient):

Unpleasant Gradient Badge

<span style="background: linear-gradient(135deg, #A3D700, #FF4F81, #7B4D3A); color: white; padding: 10px 20px; border-radius: 5px;">Unpleasant Gradient Badge</span>


The <div> Tag, Backgrounds, and Alignment
(How to make cute boxes for your code)


Click me to learn about the <div> tag my beloved
Includes how to align text and make "container" backgrounds



The <div> tag is used to group content for styling or layout purposes, essentially, it creates a "block" with all the content inside of it.


Alignment:

- Center Alignment: Use text-align: center; to center text within a div.
- Left Alignment: Default is left alignment (no code needed for this).
- Right Alignment: Use text-align: right; to align text to the right.

Example of a Right-Aligned <div>:

<div style="text-align: right;">This text is right-aligned!</div>

This creates a div with right alignment text:

This text is right-aligned!
Using Backgrounds on a <div>:

You can easily add a background color or image to a div! Makes cute little "box" containers for your code


Example of a Background Color:

<div style="background-color: #47A6B8;">This div has a light blue background!</div>

This creates a div with a light blue background:

This div has a light blue background!

Example of a Background Gradient:

<div style="background: linear-gradient(to right, #7B2F91, #4E4C9D);">This div has a gradient background!</div>

This creates a div with a gradient background:

This div has a gradient background!


Example of an Image Background:

<div style="background-image: url('https://i.imgur.com/mJQEcD5.jpeg'); background-size: cover; color: white; padding: 20px;">This div has an image background!</div>

This creates a div with an image background:

This div has an image background!

Example of an Image Background + Rounded corners :

<div style="background-image: url('https://i.imgur.com/mJQEcD5.jpeg'); background-size: cover; border-radius: 50px; color: white; padding: 20px;">This div has an image background and rounded corners too!</div>

This creates a div with an image background and rounded corners:

This div has an image background and rounded corners too!

"Hey! There's a "padding" tag in there that I don't recognize!"

Padding is the space between the content and the border. It's there so it doesn't look all shrink-wrapped and ugly :(

Comparison:

Badge Without Padding:

I'm a sad badge with no padding

<span style="background-color: #4E4C9D; color: white; border-radius: 5px;">I'm a sad badge with no padding</span>


Badge With Padding:

I'm extra chunky

<span style="background-color: #4E4C9D; color: white; padding: 15px; border-radius: 5px;">I'm extra chunky</span>


Why is all my text posting in the same line?
(How to use <br> and <hr> Tags)


Click me to learn about line breaks and horizontal rules!
Easiest one in here!



The <br> tag is used to insert a line break in your text, while the <hr> tag creates a horizontal line, often used as a divider. If you don't use them, your content may sometimes be all combined into a single line.

<br> (Line Break):

Use the <br> tag to break lines without starting a new paragraph.

Example:

This text will have a line break here.
And this text is on a new line!
You can even use multiple

for even more space.


<hr> (Horizontal Rule):

Use the <hr> tag to create a divider.

Example:

Text above the divider


Text below the divider.


Basic Text Formatting:
(Bold, Italics, Underlined, Striked, Code, Etc)


Click me for a quick cheat sheet!
Second easiest!



You can format your text using the following tags:

Bold Text:

Use the <strong> or <b> tag for bold text.

Example: This text is bold!


Italic Text:

Use the <em> or <i> tag for italicized text.

Example: This text is italicized!


Underlined Text:

Use the <u> tag for underlined text.

Example: This text is underlined!


Strikethrough Text:

Use the <del> or <s> tag for strikethrough text.

Example: This text is strikethrough!


Code Text:

Use the <code> tag for code snippets!

Example: This is code text!


Small Text:

Use the <small> tag for smaller text.

Example: This text is smaller!

Example 2: This text is even smaller! Use the tag more times to "stack" the effect.


Subscript Text:

Use the <sub> tag for subscript text.

Example: Well, hello there! I am tiny subscript text.


<details> and <summary> Tags:
(How to Create a Collapsible Drawer/Spoiler)


Click me to learn how to use make collapsible drawers
Useful for keeping your posts organized! Especially extra long ones like this one cry emoji



The <details> tag creates a collapsible drawer that hides or shows content when clicked! Just like the ones you've been clicking so far. The <summary> tag inside of <details> specifies the visible text that that the user can click on to expand or collapse the content.

Basic Structure:

To create a collapsible drawer, you’ll need a <details> tag and a <summary> tag right underneath.

 <details> <summary>Click me</summary> <p>Here is the hidden content!</p> </details> 

Example:
Click to see a hidden message!

Your chickens are super cute and if you share them in the comments I will give them lots of pets.


Customizing the <summary> Style:

You can actually put pretty much anything inside the <summary> tag! For example, I've been using badges for this post. You can also format the text just like you would anywhere else.


Creating Columns with Tables

Click to learn how to create columns

You can use an HTML table to create columns; maybe there's a more efficient way, but this is what I've been doing, and it seems to work well enough. By adjusting the width attribute, you can control the ratio of each column.

Example:
Column 1 (30%) Column 2 (70%)

Here, the first column takes up 30% of the table's width, while the second column takes up 70%:

Code:
 <table style="width: 100%; border-collapse: collapse;"> <tr> <td style="width: 30%; border: 1px solid #ddd; padding: 8px;">Column 1 (30%)</td> <td style="width: 70%; border: 1px solid #ddd; padding: 8px;">Column 2 (70%)</td> </tr> </table>  

You can adjust the width percentage in each <td> tag to set the column ratios to be whatever you want, as long as they add up to 100% smile emoji



Changing Background and Border Colors:

To change the background color of a table or its cells, use the background-color property:

 <td style="background-color: #4268AC;">Your content here</td> 

Example:

Cell with Background Color


To change the border color, adjust the border property:

 <td style="border: 1px solid #ff0000;">Your content here</td> 

Example:

Cell with Red Border


If you want to remove the borders entirely, set the border property to none:

 <td style="border: none;">Your content here</td> 

Example:

Cell without Border



Dropdown Menus with Links (Ready to use)

Click to learn how to create dropdowns

This website uses Bootstrap, which means we can use these! Just copy one of the templates below and customize it with your own links

Dropdown Menu Example:


Dropdown template code



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-primary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-secondary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-success dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-warning dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-danger dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 



Code:
 <div class="d-flex justify-content-center"> <div class="dropdown"> <a class="btn btn-info dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"> Menu Title Here </a> <ul class="dropdown-menu"> <li><a class="dropdown-item" href="ITEM #1 URL HERE" title="Description for Item #1">ITEM #1 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #2 URL HERE" title="Description for Item #2">ITEM #2 NAME HERE</a></li> <li><a class="dropdown-item" href="ITEM #3 URL HERE" title="Description for Item #3">ITEM #3 NAME HERE</a></li> </ul> </div> </div> 

Customization:

To customize the dropdown:

  • To add more links, add more <li><a class="dropdown-item" href="URL">Your Link Text</a></li> elements inside the <ul class="dropdown-menu">.
  • For link titles/tooltips, add a title="Your Tooltip Text" inside each <a> and it'll show on hover.
  • To align the dropdown button, modify the <div class="d-flex justify-content-center"> class:
    • For left alignment, use <div class="d-flex justify-content-start">.
    • For right alignment, use <div class="d-flex justify-content-end">.
    • For center alignment, use <div class="d-flex justify-content-center">.



That's all for now!!

I will be updating this with more stuff as I learn it! If you've seen me use something in any of my codes that you'd like to use as well and is not explained here, please let me know and I'll try to add it! :]

Replies

asprg 6 months ago Reply

surprise emojisurprise emojisurprise emojiheart emoji super handy guide!!! Thank you for putting it together aa emoji

@asprg yay!! Glad you find it useful surprise emoji

I'd been manually resizing images since I couldn't figure out how to change the img size in html, this is gonna make a world of difference! Thank you so much for this guide, it's awesome!smile emojiheart emojiheart emojiheart emoji

@chicken omg I'm glad ot be of help!! I was actually doing the same with the dividers in my code until I figured it out cry emoji

LvEx 6 months ago Reply

surprise emoji! emoji! emoji! emoji! emoji! emoji this is great, tysm!!

@LvEx Hope you find it useful!!! plead emojiheart emojiheart emojiheart emoji