Free Code Camp Flashcards
what does target=”blank on a link mean?
it means that when you click on a link it opens in a new window
how do you create an internal link to another section of the website?
on the href of the a tag…. you add the id of the section you want to go to
a href=#contactsPage
how do wwe comment out in html? (non shortcut)
basically two arrows using dashes, the first set gets an exclamation point
how do you make an image a link?
nest the img tag inside of an anchor tag
a href >
img src />
/a>
What does HTML stand for?
Hyper Text Markup Language
Using the analogy of a body, what is HTML?
The bones of the body.
h1 is the first h tag, what is the lowest ?
it goes from h1 - h6
What is the purpose of h1 - h6 tags
Tells the browser about the structure of your page
h1 is specifically used for what?
Main heading of page
h2 is specifically used for what?
sub headings on page
h3 - h6 is specifically used for what?
for different sections on the page
What does every img tag need?
an alt tag
What does an alt tag do? What is the purpose?
In the event that a picture doesnt load, the alt tag’s text will be displayed so we will still know what it is.
What is the difference between an ul and an ol tag? And what do they stand for?
The ul, is an unordered list - meaning that the order of the list item doesnt matter. The list items are bulleted.
The ol, is an ordered list - meaning that the order of the list items does matter. The list items are numbered.
When do you use an input tag?
When you want the user to input information, or you want to gather information from the user.
What type of input do you use when you want the user to enter text?
input type =”text”
What do we want to wrap a collection of our inputs in?
a form tag
What attribute do we want to place on a form tag? And what does its value do?
action =
its value tells the form what to do with the information that has been input by the user.
How does a form tag know when the user is done entering information inside of the input tags it contains?
The best practice is a submit button that a user can click at the end of the form. This will trigger the action attribute on the form tag.
button type=”submit”
What is the required attribute on an input tag do? And When do we want to use it?
It makes an input box required to be filled for the submit button to work.
What are radio buttons and how do you render them?
Radio buttons are for when you want the user to pick only one answer out of a list of choices.
input type=”radio”
What should we always nest our radio and checkboxes inputs in ?
a label tag
What do label tags do?
a label renders the name of the choice to the user so they can see what they are clicking.
What happens if you dont use label tags on checkboxes and radio buttons?
The boxes and buttons will have no names for the user so he or she will not be able to make a selection because they wont know what they are actually choosing. It’s pointless without labels
Paragraph One
Paragraph Two
Paragraph Three
Paragraph One
Paragraph Two
Paragraph Three
Hello World
Lets render this to the DOM
The current date is: {props.date}
{props.tasks.join()}
}; ```Current Quantity of Items in Cart: {props.quantity}
} ``` This is setting the DEFAULT PROPS ----------- Items.defaultProps = { quantity: 0 } This is the PARENT COMPONENT OVERRIDING -------------- ``` class ShoppingCart extends React.Component { constructor(props) { super(props); } render() { return <== override } }; ```{this.state.name}
{name}
{this.state.text}
Hello, my name is: {this.props.name}
<== accessing state data passed as prop from parentGet Input:
<== applying function of parent in the child after being passed as a prop{this.props.value}
} }; ```Displayed!
Displayed!
} we can also chain these together to add multiple conditions if this...and that... and that....and that....and that...and that...and that is true return this.....example psuedocode{ this.props.fiftyFifty ? 'You Win!': 'You lose!' }
``` this would say if props = true return you win if it is false return you lose to the DOM you can set up code that will either make the prop 50/50 either true or false before it passes it to the child component and then the component will render a particular type of code depending.- {items}