Revision Flashcards
What is the script tag used for ?
used to define the frontend JavaScript for a web page
where can the script element and tag be used ?
in the body or the head, depending on how you want the page to load.
What type of slash does the closing tag of an html tag take?
a forward slash
what is the definition of an HTML element?
some form of inner content that is wrapped in an html tag
Do all html tags have to have inner content?
no for example the image tag doesnt have inner content
what three things does attributes consist of?
a property, equal sign, value in quotes
href = “https//:www.website.com”
when creating a link to a website what do we need to make sure we add before the www of a webpage?
https://
when adding an alt attribute to an image tag, does the alt take the same quotations as the src attribute?
no, they are two separate attributes, therefore they have two different values and equal signs along with their own separate sets of quotation marks
what element should you wrap the H1 (and h2 if used as a subtitle for h1) in?
the header tag
what two things should you always add to the head section when creating a page?
a title
and a meta tag with the description of the page
how can we make a phone number a link?
the same way you make an email a link, but instead you use tel: instead of mailto:
a href=’tel:+14153612507> 415 361 2507
what is the content layer?
it is the layer of code that describes the html structure of a webpage
what is the presentation layer?
the presentation layer is the layer of code that css controls - the presentation of the structured content (content layer)
what two things does a rule set consist of?
a selector and declaration box
psuedo class targets what?
specific state of an element
psuedo element targets what?
specific part of the element
how to link css to a html page
head
link rel=”stylesheet” type=”text/css” href=”./css/main.css”
/head
when applying a font with two names using font-family: in css how do we type it in? do we add the space? underscore? make it one word?
you type it normal
without the space or any other punctuation or features
font-family: font name
what preset values can font-weight be set to?
normal Defines normal characters. This is default
bold Defines thick characters
bolder Defines thicker characters
lighter Defines lighter characters
what numerical values can font-weight be set to?
100 200 300 400 (same as normal) 500 600 700 ( same as bold) 800 900
what are some common background-size property values?
auto
number/percent
cover
contain
what does the auto value for the background-size property mean?
its the default setting and sets the image to its original size/dimensions
what does the cover value for the background-size property mean?
it means that it will stretch the image so it covers the whole space, even if it has to cut off some of the edges to make it work
what does the contain value for the background-size property mean?
it means that it will make sure all of the image is shown within the dimension of the parent element
what are the most common values for background-repeat property?
repeat repeat-y repeat-x no-repeat space round
what does the repeat value of the property background-repeat do?
it repeats the image both horizontally and vertically. The last image will be clipped if it doesnt fit
what is the default value for the background-repeat property?
repeat
what does the repeat-y value of the property background-repeat do?
repeats the image only vertically
what does the repeat-x value of the property background-repeat do?
repeats the image only horizontally
what does the no-repeat value of the property background-repeat do?
the image doesnt repeat it is only shown once
what does the space value of the property background-repeat do?
The background-image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images (gaps)
what does the round value of the property background-repeat do?
The background-image is repeated and squished or stretched to fill the space (no gaps)
what to remember when using linear-gradient to add a transparent tint over a background image?
you must put the linear gradient and transparent tint higher in the cascade, before you put the background-image and url because if the image goes first it will override the linear gradient tint.
so put the tint first and then add the url
or put the url and then just make sure the gradient is higher in the cascade
what goes between a linear gradient value and a url value on background-image property?
a comma
what should you put first on a background-image property a linear gradient or the image url if you need to use both?
linear gradient and then the background url
linear gradient goes on what property?
it goes on a background image property
when using pseudo elements ::after and ::before what do we need to put in the declaration box to add specific characters or strings ?
content : “ “
in between the quotes you add what you want to show up before or after the element selected
how many colons do pseudo classes take?
a single colon
paragraph:hover{
color: red;
}
how many colons do pseudo element take?
two
paragraph::before{
content: ‘“’
}
how do we keyboard cycle forward through clickable elements on a webpage?
the Tab button
how do we keyboard cycle backward through clickable elements on a webpage?
hold the shift key and click the Tab button
how to use css to rotate an image?
img {
transform: rotate(180deg)
};
what are the 5 most common ways to target specific attribute selectors in css?
[attribute=”value”] - exact match
[attribute*=”value”] - match of string/no space
[attribute^=”value”] - match beginning
[attribute$=”value”] - match end
[attribute~=”value”] - match word with space recognized as character
what is an inline element?
an element that does not start on a new line and flow goes horizontally, usually some sort of text. Height and width cannot be explicitly set, height and width are determined by the content
what are block elements?
elements that start on a new line, height and width can be explicitly set. Flow goes vertically
what are inline block elements?
elements that have the same characteristics of a block element, but flow has been changed to go horizontally
how do we remove white space between inline block elements if there is some?
we make font-size: 0 on the parent element
what happens when we put two inline elements one after the other on the same line?
they are rendered next to each other with no space.
span Hello /span span World /span
result:
HelloWorld
what happens when we put two inline elements one after the other but on two different lines?
they are rendered on the same line but with a space between the two
span Hello /span
span World / span
result
Hello World
Can we change inline elements into block elements and vice versa?
yes we can, by using the display: property
when is it a good idea to change the display property of an element?
when semantically it is correct but the display default doesn’t work for your design.
what is an example of a time where you might want to change the display of an element even though it may be semantically correct?
a nav bar goes vertically because it is a block element, but changing it to inline allows it to go horizontally as we see on the top of websites… for sections like home, contact us, share etc.
when do you use margin-right: auto; and margin-left: auto; on an block element ?
when you want to horizontally center it in relation to its parent element.