Categories
HTML

How to add text-align class for inside a table with Bootstrap and HTML?

To add text-align class for inside a table with Bootstrap and HTML, we use the classes starting with text-.

For instance, we write

<p class="text-xs-left">Left aligned text on all viewport sizes.</p>
<p class="text-xs-center">Center aligned text on all viewport sizes.</p>
<p class="text-xs-right">Right aligned text on all viewport sizes.</p>

<p class="text-sm-left">
  Left aligned text on viewports sized SM (small) or wider.
</p>
<p class="text-md-left">
  Left aligned text on viewports sized MD (medium) or wider.
</p>
<p class="text-lg-left">
  Left aligned text on viewports sized LG (large) or wider.
</p>
<p class="text-xl-left">
  Left aligned text on viewports sized XL (extra-large) or wider.
</p>

to add the text- classes to align left with left.

We center align with center.

And we center align with right.

xs, sm, lg, and xl are breakpoints.

Categories
HTML

How to fix stylesheet not loaded because of MIME-type with HTML?

To fix stylesheet not loaded because of MIME-type with HTML, we should make sure the link element has the right attributes.

For instance, we write

<link rel="stylesheet" src="dist/photoswipe.css" />

to add a link element with the rel attribute set toi stylesheet.

And we set the stylesheet URL as the value of the src attribute.

Categories
HTML

How to add a tooltip to a div with HTML?

To add a tooltip to a div with HTML, we set the title attribute.

For instance, we write

<div title="This is my tooltip">tooltip</div>

to add a div.

Then we set its title attribute to the tooltip text.

We see the tooltip when we hover over the div.

Categories
HTML

How to change the interval time on Bootstrap carousel with HTML?

To change the interval time on Bootstrap carousel with HTML, we set the data-interval attribute.

For instance, we write

<div
  data-ride="carousel"
  class="carousel slide"
  data-interval="10000"
  id="myCarousel"
>
  ...
</div>

to set the data-interval attribute to 10000ms to make the carousel update every 10000ms.

Categories
HTML

How to submit the value of a disabled input field with HTML?

To submit the value of a disabled input field with HTML, we add a hidden field with the name and value attribute values.

For instance, we write

<input type="text" value="22" disabled="disabled" />
<input type="hidden" name="lat" value="22" />

to add a disabled and hidden input with the same name and value attribute values so that the hidden value’s input is submitted.