Prelims - CSS borders Flashcards

1
Q

properties that allow you to specify the style, width, and color of an element’s border

A

CSS border

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

property specifies what kind of border to display

A

border-style

ex. p.dotted {border-style: dotted;}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The following border values are allowed:

A
  • dotted - Defines a dotted border
  • dashed - Defines a dashed border
  • solid - Defines a solid border
  • double - Defines a double border
  • groove - Defines a 3D grooved border. The effect depends on the border-color value
  • ridge - Defines a 3D ridged border. The effect depends on the border-color value
  • inset - Defines a 3D inset border. The effect depends on the border-color value
  • outset - Defines a 3D outset border. The effect depends on the border-color value
  • none - Defines no border
  • hidden - Defines a hidden border
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

property specifies the width of the four borders

A

border-width

p.one {
  border-style: solid;
  border-width: 5px;
}

p.two {
  border-style: solid;
  border-width: medium;
}

p.three {
  border-style: dotted;
  border-width: 2px;
}

p.four {
  border-style: dotted;
  border-width: thick;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The border-width property can have from one to four values

A

top, right, bottom, left

p.one {
  border-style: solid;
  border-width: 5px 20px; /* 5px top and bottom, 20px on the sides */
}

p.two {
  border-style: solid;
  border-width: 20px 5px; /* 20px top and bottom, 5px on the sides */
}

p.three {
  border-style: solid;
  border-width: 25px 10px 4px 35px; /* 25px top, 10px right, 4px bottom and 35px left */
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

property is used to set the color of the four borders

A

border-color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The border color can be set by

A
  • name - specify a color name, like “red”
  • HEX - specify a HEX value, like “#ff0000”
  • RGB - specify a RGB value, like “rgb(255,0,0)”
  • HSL - specify a HSL value, like “hsl(0, 100%, 50%)”
  • transparent

If border-color is not set, it inherits the color of the element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The border-color property can have from one to four values

A

top, right, bottom, left

p.one {
  border-style: solid;
  border-color: red green blue yellow; /* red top, green right, blue bottom and yellow left */
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In CSS, there are also properties for specifying each of the borders

A

border-top-style
border-right-style
border-bottom-style
border-left-style

p {
  border-top-style: dotted;
  border-right-style: solid;
  border-bottom-style: dotted;
  border-left-style: solid;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The border property is a shorthand property for the following individual border properties:

A

border-width
border-style (required)
border-color

p {
  border: 5px solid red;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

property is used to add rounded borders to an element

A

border-radius

How well did you know this?
1
Not at all
2
3
4
5
Perfectly