html and css basics Flashcards
when creating a new file, why does it have to end with a .html or .css? e.g website.html
This tells the computer, this file contains html code rather than text
how do you create a button?
<button></button>
what is a html element?
An HTML element is defined by a start tag, some content, and an end tag.
what is syntax?
The rules that govern the structure of the symbols, words, and punctuation found in programming languages.
what is an anchor element and what is the code to create a link to a website?
an anchor element link to another website. <a>link to youtube</a>
what is a html attribute and give an example?
html attribute = modifies how an element behaves, e.g href- is the attribute name “” is the attribute value. The attribute name tells us what we are modifying and the value tells us we are modifying it to.
how many attributes can you have on an element?
you can have multiple attributes.
when creating a link what attribute do you need to make it in a new tab.
target=”_blank”
give an example of multiple attributes in 1 anchor element
<a>link to youtube</a>
what element do you need to write css?
<style></style>
what is a css selector? give an example
css selector= which elements we’re targeting.
button {
}
Targeting all button on the page.
what is a css property and a css value? give an e.g
css property = it tells the computer what we are changing,
css value = what we are changing the property to
button{
background-color: red;
}
background color is the css property because it tell the computer we are going to change the background colour.
red is the css value because we are changing the background colour to red.
create a button (the button has to say subscribe) with the css property and value listed below:
background colour - red
text colour - white
border - none
height - 36px
width - 105px
rounded corners on the border
change the cursor to a pointer
<style>
button { background-colour: red; color: white; border: none; height: 36px; width: 105px; border-radius: 2px; cursor: pointer; }</style>
<button>SUBSCRIBE</button>
what is rbg and what does it stand for?
RGB (red, green and blue) refers to a system representing the colors used on a digital display screen.
what is a class attribute and what does it do and give an example.
class attribute, class=””
<style>
.subscribe-button { background-colour: red; color: white; border: none; height: 36px; width: 105px; border-radius: 2px; cursor: pointer; }</style>
<button>SUBSCRIBE</button>
This means all the css code will only apply to the subscribe button not anything else.