Computer Science - Web Technologies Flashcards
Web Technologies
HTML and CSS are mark-up languages used to create a webpage. It is possible to combine these with the programming language JavaScript to process and display data dynamically on a webpage. Search engines index pages and can be used to locate the information that you need in the vast array of data on the World Wide Web.
HTML
- HTML stands for Hypertext Markup Language
- is the standard markup language for web pages.
- Tags are used to specify elements of a webpage
- Tags can be used to define structural elements of a page, such as a navigation bar or a footer
- A web browser will interpret the tags to display the page
- HTML can be combined with CSS
- CSS standards Cascading Style Sheets
- CSS can be in tandem to improve on the default presentation of elements and a skilled design can use CSS to create stunning web sites
HTML - How to write in HTML
- To write HTML, a text editor and a web browser are needed
- there are a wide variety of text editors that can be used
- some websites allow you to write HTML code and have the results displayed directly in your browser
- HTML docs have the file extension .html
- HTML docs also, if saved, usually default to opening up in your web pages
- You can view an HTML doc either as the web page or as the HTML code which generates that page
- It is important to remember that the type of application you use to open the HTML file will impact its display.
HTML - HTML tags
- The <p> tag is used to specify a paragraph and must be ended with </p>
- A paragraph is a basic building block of a webpage.
- There are some rules for displaying paragraphs
- By default, browsers separate paragraphs with a single black line and the text is left-justified
- You can override the default browser presentation rules by using CSS.
- The process of processing the HTML for display purposes is called rendering
- Semantic HTML is the term used where tags have been used purposefully to reinforce the meaning of content on a page
- semantically correct HTML helps to make sure that people and machines make sense of it
- This allows the page to be correctly interpreted by screen readers and other user devices.
HTML - HTML page structure
- The entire content for an HTML page would be enclosed by a pair of tags.
- The section contains any content that doesn’t appear directly in the main window of the page
- The that will appear with the tab for the page when it is viewed in a web browser
- Below the head section is the which contains the main content of the page
- Leaving multiple spaces or moving text onto a new line in your code does NOT mean that space is placed on the page your visitors will see.
- The <br></br> tag will add an extra blank line anywhere on the page
- The <br></br> tag does not have a closing tag because it has no content to enclose
- You can also use comments in your markup
HTML - Headings
• Headings are used on web pages to introduce a section of the page
• The HTML tag for headings is , where the # is replaced by a number between 1 to 6.
• The higher the number in the heading tag, the lower the priority of the heading
• The lower the priority of the heading the smaller the text the browser
• Heading tags also have semantic meaning within the page.
• Things that shouldn’t be headings if they aren’t tagged as them
• The main <h1> heading tag is used by search engines in summarisations, as well as to help users skim over the content and provide extra information to users of assistive technology
</h1>
HTML - Images
- The image tag is <img></img>
- The syntax for it is <img></img> where src has the link for the image, and alt has the description for the description
- The image has to be saved in the same folder as the HTML code
- There is no closing tag for the image tag
- another piece of information needed for the image is the height and width of the image, which can be used to change the size of the shape
- It is not recommended you re-size the image through HTML code because doing this means you need to download the original image before it can be resized, which can take some time, The browser may also not be the best tool to resize the image, as there is always specialist image editing programs instead as well as the fact that there must be careful to keep the aspect ratio the same to make sure the image does not become distorted
HTML - Hyperlinks
- A hyperlink is a piece of text that when clicked on, will transfer you to another page
- The tag for a hyperlink is <a></a>
- The tag must have a href after the a which specifies the target of the link
- An unvisited link is underlined and blue, a visited link is underlined and purple and an active link are underlined and red.
- the </a><a> tag stands for anchor</a>
- </a>
HTML - Lists
- A list is a very useful thing to have on a web page
- A list is creating using <ol> for an ordered list or </ol><ul> for an unordered list
- Individual items are added with the <li> tag
- to end the list you would use either </li> or </ul>
- Lists can also be used to create menus and navigation bars
- in this case the list items will be hyperlinks and their layout and appearance will be customised using CSS.
HTML - Forms
- The HTML tag for forms is
- Forms also use the HTML tag to insert things into the form, such as buttons or search bars
- Forms are used to enter data
- To input things into forms more information is needed, these are known as attributes, and can contain things such as the type of data being added, the name for which it can be searched for in code, as well as what it does.
HTML - Divisions
- The HTML tag for page divisions is <div>
- The Div tag is used to crease page divisions, which are containers or boxes
- The containers or boxes can contain other elements on the page, such as text, images or form elements.
- the <div> tag can also be used to group pieces of content together within other <div> tags and then define a set of CSS style rule-set that will apply to everything in the container
- Each division must contain a unique ID, which is used to identify it.</div></div></div>
CSS
- CSS is Short for Cascading Style Sheets
- used to style the content of web pages
- CSS tells the browser how each element should appear
- allows a single style sheet to be attached to every page across every page
- Used to define all aspects of the appearance of web pages, including the design, layout and variations in display for different devices and screen sizes
CSS - CSS Syntax
- simple syntax and uses several English keywords to specify the names of various style properties
- Each rule or rule-set consists of one or more selectors and a declaration block
- There are a few key things used in CSS, these are the selector and the declaration block.
- The selector targets the element that you want to target
- The declaration block contains multiple declarations, with each declaration being made up of a CSS property and value, which could be colour for the property and grey for the value
- If no font is defined by the CSS code then whatever the browser default is will instead be the font of the webpage, the same is equal for other things which haven’t been defined
CSS - CSS Properties
• A property is a particular thing that can be changed such as the background colour.
• There is a list of properties with which you need to be familiar for the exam, these are:
○ Background-color: Changes the colour of the
background
○ Border-color: Changes the colour of the
border around an element
○ border-style: Changes the style of the border
○ border-width: Change the width of the border
can be set to thin/medium/thick, or a specific
width of pixels
○ color: Changes the colour of the text, can be
specified with a word or as a hexadecimal
value
○ font-family: changes the font
○ font-size: changes the size of the font
○ height: changes the height of the element
○ width: changes the width of the element
CSS - Element Selectors
- An element selector applies a CSS rule-set to a standard HTML tag
- The name of the selector is the name of the element that you wish to style