Content Color Boxcreate A Colored Content Box.

Posted on  by 

The above example contains the blurred shadow and the white colored text. Increase or decrease the third-pixel value of box-shadow property to add more blurry effect to the content. Add shadow effect on text HTML with blur shadow effect. Display Blurred Shadow Effect With Transparent Color. If you want to display only the shadow and not the. Step 1: Creating a Colored Text Box with HTML. Head over to the piece of content that you want to add your colored text box to. You need to go to the “Text” tab of the wordpress text editor since you’ll be entering some code. Now find the sentence/text or whatever else you want your colored text box to contain. From here, add this to the beginning of your text/sentence.

(Redirected from Template:Colorbox)
Template documentation[view] [edit] [history] [purge]
  • {{Colorbox}}
  • {{Colourbox}}
  • {{Colour box}}
  • {{Color square}}
  • {{Legend3}}
  • Color: #FFFFFF; = is the text color of your box; padding: 10px; = is the space between your text and the edge of your box #000000 = is the HEX color code for Black; #FFFFFF = is the HEX color code for White; THIS IS THE BOX FOR YOUR TEXT. INSERT YOUR TEXT HERE = This is where you replace this text with the text you want in your box. Padding is important. The padding will keep your text away from the edge of the box.
  • Adds a rectangular color box. Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details. If specified, the text is centered within the box.
This template uses TemplateStyles:

Usage

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Color box

{{color box|color|text|text color}}
Adds a rectangular color box. Content Color Boxcreate A Colored Content Box.
  • Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.
  • If specified, the text is centered within the box.
ParameterDescriptionTypeStatus
Color1
Example
Green
Stringrequired
Text2
Adds text inside the box; box is otherwise an empty square.
Example
Hello, world!
Stringsuggested
Text color3
Default
Either black or white; whichever has greater contrast.
Example
Yellow
Stringsuggested
Border colorborder
Sets the color of the border around the box.
Default
black
Example
#FF0
Stringoptional

Format: inline

Test of raw TemplateData output

The 7 Salts Your Kitchen Needs

:

Adds a rectangular color box. Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.If specified, the text is centered within the box.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Color1

Background color of the box.

Example
Green
Stringrequired
Text2

Adds text inside the box; box is otherwise an empty square.

Example
Hello, world!
Stringsuggested
Text color3

Sets the color of the text inside the box.

Default
Either black or white; whichever has greater contrast.
Example
Yellow
Stringsuggested
Border colorborder

Sets the color of the border around the box.

Default
black
Example
#FF0
Stringoptional
Examples
Visual effectMarkup
{{color box|Green}}
Default color for this text {{color box|Yellow|Default color for this text}}
Default color for this text {{color box|Blue|Default color for this text}}
Using X11 color names{{color box|SteelBlue|''Using X11 color names''|Gold}}
Using RGB hex triplets{{color box|#012345|'Using RGB hex triplet'|#FEDCBA}}
Red {{color box|Yellow|Red|#f00|border=#f00}}
bordercolor like wikitable {{color box|white|bordercolor like wikitable|border=#A2A9B1}}

Variants

TemplateDescriptionExample
{{Color box}}a small color box with black borders and text color or ORANGE
{{Color box striped}}a striped version
{{RouteBox}}a borderless version with text color and wikilinksORANGE
{{Colorbull}}a colored bullet with wikilinks
{{Legend2}}another borderless version
{{Color sample}}a small color box with black borders
{{Swatch inline}}orange
{{Background color}}orange
{{Rail color box}}a version with more display options
(part of Module:Adjacent stations)
, Orange, etc.
{{Diagonal split color box}}a small color box split diagonally, etc.
{{Motor type}}A small color box corresponding to the motor type
A
, etc.

Supporting template

  • {{Greater color contrast ratio}}

See also

  • {{Infobox color}}, an infobox for the detailed description of a color.
  • {{Legend}}
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Template:Color_box&oldid=981678883'

The CSS opacity property is a great way to set a low opacity on HTML elements making the entire element semi-transparent including all of its children. But what if we only wish to set the opacity on the background color whilst keeping the content (such as text and images) opaque? Here are a few ways to accomplish that:

Set Background Color Opacity Using Alpha Channel Color Notations

We can use the following CSS3 alpha channel color functional notations to set the background color to a lower opacity:

Using the RGBA (Red-Green-Blue-Alpha) Model:

Syntax:

Where the values of each color in RGB can be an integer between 0-255 or a percentage value from 0-100%, and the value of Alpha can be a number between 0-1.

Examples:

Using the HSLA (Hue-Saturation-Lightness-Alpha) Model:

Syntax:

Where the possible values of the HSLA color notation are:

  • Hue: specified in degrees (imagine a color wheel) where:
    • 0° – red
    • 60° – yellow
    • 120° – green
    • 180° – turquoise
    • 240° – blue
    • 300° – pink
    • 360° – red
  • Saturation: specified in percentage where 0% is completely desaturated (or gray) and 100% is fully saturated (or full color).
  • Lightness: specified in percentage where 0% is completely dark (or black) and 100% is completely light (or white).
  • Alpha: a number between 0-1 where 0 is fully transparent and 1 is fully opaque.

Examples:

Use a Lower Opacity CSS Pseudo Element to Create a Colored Background Layer

By creating the content element nested inside a parent element like so:

We can create an background layer with no content via CSS pseudo elements like so:

Now we can make the background layer the same size as the parent div and position it relative to the parent div:

You should now see a pink colored background layer with an opacity of 50% that only applies to the background color and not the content.

Here's a quick explanation of how the generated content (our background layer) is styled:

  • To generate empty/invisible content we can simply set the content property's value to an empty string or a space character.
  • Setting width and height to 100% ensures the generated content is of the same size as the parent element.
  • Setting a lower opacity makes the background layer transparent.
  • position: relative on the parent element and position: absolute on the generated content ensures the generated content is positioned relative to the parent.
  • Setting left: 0 and top: 0 ensures the generated content is positioned to the top left edge of the parent element.
  • Setting a negative z-index value ensures the generated content recedes to the background and all child element content appears above it.

Template:Color Box - Wikipedia

If the parent element has a background color of its own, then you can set a positive z-index value on the generated content (the background layer) and a higher z-index value on the child element along with relative positioning like so:

Hope you found this post useful. It was published (and was last revised ). Please show your love and support by sharing this post.

Coments are closed