import{_ as a,c as s,o as t,ah as n}from"./chunks/framework.j4Nev8bF.js";const g=JSON.parse('{"title":"HTML & CSS","description":"","frontmatter":{},"headers":[],"relativePath":"rebel_coding/step1.md","filePath":"rebel_coding/step1.md"}'),i={name:"rebel_coding/step1.md"};function l(o,e,p,r,h,d){return t(),s("div",null,[...e[0]||(e[0]=[n(`<h1 id="html-css" tabindex="-1">HTML &amp; CSS <a class="header-anchor" href="#html-css" aria-label="Permalink to “HTML &amp; CSS”">​</a></h1><hr><p>HTML &amp; CSS are the basic building blocks for most web-pages, and dare I say mobile applications. In the following example we compare building a webpage to building a house or similar structure.</p><p>HTML code determines the structural look of a web page. This is the layout, walls, stairs, and open spaces for doors, windows, outlets, and the like. CSS is the paint colors, motifs and patterns that will decorate our structure, while also able to influence structural aspects (think mobile designs).</p><p>HTML also introduces us to our first basic pattern in coding.</p><p><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;</code></p><p>HTML uses <em>tags</em>, enclosed by arrows (&lt;&gt;), to contain information. Notice how each tag has an explicit beginning and an explicit end. We gotta make sure we finish what we start!</p><p>Below is a code example containing, <em>nearly</em>, the least amount of code needed to display a webpage using HTML.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;html&gt;</span></span>
<span class="line"><span>        &lt;head&gt;</span></span>
<span class="line"><span>            &lt;title&gt;Home&lt;/title&gt;</span></span>
<span class="line"><span>        &lt;/head&gt;</span></span>
<span class="line"><span>        &lt;body&gt;</span></span>
<span class="line"><span>            &lt;h1&gt;Welcome to Rebel Coding&lt;/h1&gt;</span></span>
<span class="line"><span>        &lt;/body&gt;</span></span>
<span class="line"><span>    &lt;/html&gt;</span></span></code></pre></div><p>That&#39;s it! It’s our little dollhouse of a webpage!</p><p>Granted ... all the webpage has, is a headline that says &quot;Welcome to Rebel Coding&quot;.</p><h2 id="html-page-structure" tabindex="-1"><a href="#html-page-structure">#</a> HTML Page Structure <a class="header-anchor" href="#html-page-structure" aria-label="Permalink to “# HTML Page Structure”">​</a></h2><p>So what’s going on with these first HTML tags?</p><p><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;</code></p><p><strong>HTML:</strong> Declarative containers to announce what language we&#39;re using; you might also you see a DOCHTML tag.</p><p><strong>Head:</strong> Unseen information, pulling in files.</p><p>Later on we’ll be getting our own set of files to start with; and in the <code>&lt;head&gt;</code> tag you’ll see a bunch of <code>&lt;link&gt;</code> tags that have links to other files. This is like the brain gathering all the information the <code>&lt;body&gt;</code> below will need to carry out its prescribed operations.</p><p><strong>Body:</strong> Where all the visible action happens!</p><h2 id="nested-properties-attributes" tabindex="-1"><a href="#nested-properties-attributes">#</a> Nested Properties / Attributes <a class="header-anchor" href="#nested-properties-attributes" aria-label="Permalink to “# Nested Properties / Attributes”">​</a></h2><p><strong>Basic coding concept #2:</strong> nested properties, attributes and objects.</p><p>Let’s introduce the <code>&lt;h1&gt;</code> tags with this topic.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;h1&gt;Header 1&lt;/h1&gt;</span></span>
<span class="line"><span>    </span></span>
<span class="line"><span>    &lt;h2&gt;Header 2&lt;/h2&gt;</span></span>
<span class="line"><span>    </span></span>
<span class="line"><span>    &lt;h3&gt;Header 3&lt;/h3&gt;</span></span></code></pre></div><p>But what if I want Header 1 to be the color green??</p><p><code>&lt;h1 style=”color: green;”&gt;Header 1&lt;/h1&gt;</code></p><p>Important to notice how deeply nested structures can become.</p><p>Here we have a property <code>color</code> within a property <code>style</code> within a tag <code>h1</code>!!</p><p>And this is just the beginning of the idea; how objects can contain other objects, be they variables, functions or entirely other objects themselves ~ in JavaScript everything is an object though ~~ eeks, more later!</p><h2 id="basic-html-tags" tabindex="-1"><a href="#basic-html-tags">#</a> Basic HTML Tags <a class="header-anchor" href="#basic-html-tags" aria-label="Permalink to “# Basic HTML Tags”">​</a></h2><p>As we’ve just noted, HTML tags have a beginning and an end:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;title&gt;Home: Rebel Coding&lt;/title&gt;</span></span></code></pre></div><p>This title tag is an excellent example; it defines the title of our webpage.</p><p>HTML tags also have properties, or attributes, of their own.</p><p>Another common HTML tag is the <code>&lt;a&gt;</code> tag, or anchor tag.</p><p>The HTML tag is what connects the web, using its <em>property</em> ‘href’.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;a href=”http://www.duckduckgo.com”&gt;DuckDuckGo&lt;/a&gt;</span></span></code></pre></div><p>And tags can have more than one attribute, or property; an important one is the class property:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;table class=”table”&gt;&lt;/table&gt;</span></span></code></pre></div><p>As we’ll see later, classes (and id’s) can be used to modify a group of components in our webpage/application.</p><p>Lists are just good to go over; both ordered, and unordered lists; can you tell the difference?</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;</span></span>
<span class="line"><span>    </span></span>
<span class="line"><span>    &lt;ol&gt;&lt;li&gt;&lt;/li&gt;&lt;/ol&gt;</span></span></code></pre></div><p>These HTML tags don’t seem to end, or do they?</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;img/&gt;</span></span>
<span class="line"><span>    </span></span>
<span class="line"><span>    &lt;br/&gt;</span></span></code></pre></div><p>That’s because the ending is embedded at the tailing slash :0)</p><p>Some tags have no information to include between a start and end point, such as images or line breaks. And so, the exception is mended by placing an end slash as such.</p><p>Remember our <code>&lt;link/&gt;</code> tags within the <code>&lt;head&gt;</code> tag? Same thing; no info needed to be included between the tags; all of the info is gathered through the tag’s properties.</p><h2 id="css-cascading-style-sheets" tabindex="-1"><a href="#css-cascading-style-sheets">#</a> CSS - Cascading Style Sheets <a class="header-anchor" href="#css-cascading-style-sheets" aria-label="Permalink to “# CSS - Cascading Style Sheets”">​</a></h2><p><strong>Cascading Style Scripts</strong> are <em>scripts that style our code</em>; we&#39;ll explain the cascading part in a moment.</p><p>If I want to change the color of an item, I would use CSS; utilizing the style attribute of the header HTML tag. We saw this earlier.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;h1 style=”color: #FE23DD;”&gt;Rebel Coding&lt;/h1&gt;</span></span></code></pre></div><p>There are many different ways to use CSS, and like JavaScript, the number of CSS libraries seems to always be growing.</p><p>Regardless, the basics are as follows:</p><h3 id="inline" tabindex="-1"><a href="#inline">#</a> Inline <a class="header-anchor" href="#inline" aria-label="Permalink to “# Inline”">​</a></h3><p>Here we add the styling code directly within the tag to which it is to be applied; as shown above.</p><p>We add a <em>style</em> property to the tag we’re modifying, and then include our preferred augmentation. We are changing the color, and size of our <code>&lt;h1&gt;</code> text.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;html&gt;</span></span>
<span class="line"><span>        &lt;head&gt;</span></span>
<span class="line"><span>            &lt;title&gt;Home&lt;/title&gt;</span></span>
<span class="line"><span>        &lt;/head&gt;</span></span>
<span class="line"><span>        &lt;body&gt;</span></span>
<span class="line"><span>            &lt;h1 style=&quot;color: #42FD23; font-size: 5em;&quot;&gt;Welcome to SF&lt;/h1&gt;</span></span>
<span class="line"><span>        &lt;/body&gt;</span></span>
<span class="line"><span>    &lt;/html&gt;</span></span></code></pre></div><h3 id="embedded" tabindex="-1"><a href="#embedded">#</a> Embedded <a class="header-anchor" href="#embedded" aria-label="Permalink to “# Embedded”">​</a></h3><p>As we alluded to earlier, what makes CSS so useful is how we can use it to make adjustments to a whole groups of tags!</p><p>Instead of including a <em>style</em> property on the <code>&lt;h1&gt;</code> tag, we use the <code>&lt;style&gt;</code> tag up in the header! Now we are able to list the tags we want to affect, and define our preferences.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;html&gt;</span></span>
<span class="line"><span>        &lt;head&gt;</span></span>
<span class="line"><span>            &lt;title&gt;Home&lt;/title&gt;</span></span>
<span class="line"><span>            &lt;style&gt;</span></span>
<span class="line"><span>                h1 {</span></span>
<span class="line"><span>                    color: #42FD23;</span></span>
<span class="line"><span>                }</span></span>
<span class="line"><span>            &lt;/style&gt;</span></span>
<span class="line"><span>        &lt;/head&gt;</span></span>
<span class="line"><span>        &lt;body&gt;</span></span>
<span class="line"><span>            &lt;h1&gt;Welcome to Rebel Coding&lt;/h1&gt;</span></span>
<span class="line"><span>        &lt;/body&gt;</span></span>
<span class="line"><span>    &lt;/html&gt;</span></span></code></pre></div><h3 id="embedded-class" tabindex="-1"><a href="#embedded-class">#</a> Embedded + Class <a class="header-anchor" href="#embedded-class" aria-label="Permalink to “# Embedded + Class”">​</a></h3><p>What if you don&#39;t want to affect every <code>&lt;h1&gt;</code> tag?</p><p>We use classes! Classes are heavily used in CSS and styling libraries.</p><p>Notice how the <em>class</em> attribute, in an HTML tag, allows for more than one parameter, separated by a space. Notice that the class attribute can contain more than one class.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;html&gt;</span></span>
<span class="line"><span>        &lt;head&gt;</span></span>
<span class="line"><span>            &lt;title&gt;Home&lt;/title&gt;</span></span>
<span class="line"><span>            &lt;style&gt;</span></span>
<span class="line"><span>                h1 {</span></span>
<span class="line"><span>                    color: #42FD23;</span></span>
<span class="line"><span>                }</span></span>
<span class="line"><span>                .headline {</span></span>
<span class="line"><span>                    text-decoration: underline;</span></span>
<span class="line"><span>                }</span></span>
<span class="line"><span>            &lt;/style&gt;</span></span>
<span class="line"><span>        &lt;/head&gt;</span></span>
<span class="line"><span>        &lt;body&gt;</span></span>
<span class="line"><span>            &lt;h1 class=&quot;headline other-class&quot;&gt;Welcome to SF&lt;/h1&gt;</span></span>
<span class="line"><span>        &lt;/body&gt;</span></span>
<span class="line"><span>    &lt;/html&gt;</span></span></code></pre></div><p>Within our <code>style</code> tag, we use the <code>.</code> notation to indicate that an item is a class; <code>#</code> is used to denote ids.</p><h3 id="imported" tabindex="-1"><a href="#imported">#</a> Imported <a class="header-anchor" href="#imported" aria-label="Permalink to “# Imported”">​</a></h3><p>Lastly we must realize that for an entire application there will be a whole heap of CSS code. And having it all in the same file as the base index file would be ridiculous!</p><p>So, we are going to write a completely separate file, and <em>import</em> it into our index file.</p><p>We do this using a <code>&lt;link&gt;</code> tag, that contains two properties, <em>rel</em> and <em>href</em>. <em>rel</em> defines the relationship of the file being consumed; and <em>href</em> provides the address at which the file can be found, <em>hyperlink-reference</em>.</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>    &lt;html&gt;</span></span>
<span class="line"><span>        &lt;head&gt;</span></span>
<span class="line"><span>            &lt;title&gt;Home&lt;/title&gt;</span></span>
<span class="line"><span>            &lt;link rel=&quot;stylesheet&quot; href=&quot;./style.css&quot;/&gt;</span></span>
<span class="line"><span>        &lt;/head&gt;</span></span>
<span class="line"><span>        &lt;body&gt;</span></span>
<span class="line"><span>            &lt;h1&gt;Welcome to Rebel Coding&lt;/h1&gt;</span></span>
<span class="line"><span>        &lt;/body&gt;</span></span>
<span class="line"><span>    &lt;/html&gt;</span></span></code></pre></div><h3 id="so-what-does-cascading-styles-sheets-mean" tabindex="-1"><a href="#so-what-does-cascading-styles-sheets-mean">#</a> So what does Cascading Styles Sheets Mean ? <a class="header-anchor" href="#so-what-does-cascading-styles-sheets-mean" aria-label="Permalink to “# So what does Cascading Styles Sheets Mean ?”">​</a></h3><p><strong>Cascading</strong> refers to how instructions are interpreted.</p><p>What if the <em>style.css</em> scripts says <code>&lt;h1&gt;</code> tags should all be green, but a style property on the page specifies that this specific <code>&lt;h1&gt;</code> tag should be blue?? Which will take precedence?</p><p>And what if a style attribute is on a specific <code>&lt;h1&gt;</code> tag, saying it should be yellow?</p><p><em>Most of the time</em> the page, or component, specific parameter/property/attribute will take precedence in styling the tag. And this is attributed to the cascading nature of style scripts 😃</p><ol><li>Inline CSS modifications</li><li>Mods in the <code>&lt;head&gt;</code> tag</li><li>Imported Scripts in descending order (last to load take precedence.)</li></ol><h2 id="wireframing" tabindex="-1"><a href="#wireframing">#</a> WireFraming <a class="header-anchor" href="#wireframing" aria-label="Permalink to “# WireFraming”">​</a></h2><p>Now you need to start designing your website!! And the first step is to draw a picture.</p><p>Yup, you heard me -- bust out the crayon and markers, we gotta draw!</p><p>That’s what wireframing is -- drawing a rough outline of how you want your webpage to look -- deciding where you want certain sections to appear; heck deciding what sections you want to have in the first place!</p><p>How do you want your menu to operate?</p><p>Are you wanting to make a single, or multi-, page site?</p><p>These are the questions wireframing helps us to answer; and when we’re ready, we simply transcribe our drawings into an HTML/CSS structure.</p><h2 id="your-website-build-out" tabindex="-1"><a href="#your-website-build-out">#</a> Your Website Build-Out <a class="header-anchor" href="#your-website-build-out" aria-label="Permalink to “# Your Website Build-Out”">​</a></h2><p>You’ve got a few options to start with - you can start with a blank page or use one of the templates provided!</p><h3 id="basic" tabindex="-1"><a href="#basic">#</a> Basic <a class="header-anchor" href="#basic" aria-label="Permalink to “# Basic”">​</a></h3><p>Displays paragraphs, links, lists and tables.</p><h3 id="basic-1" tabindex="-1"><a href="#basic-2">#</a> Basic + <a class="header-anchor" href="#basic-1" aria-label="Permalink to “# Basic +”">​</a></h3><p>Implements JavaScript</p><h2 id="templating-with-bootstrap" tabindex="-1"><a href="#templating-with-bootstrap">#</a> Templating with Bootstrap <a class="header-anchor" href="#templating-with-bootstrap" aria-label="Permalink to “# Templating with Bootstrap”">​</a></h2><p>One of the first CSS libraries was called Bootstrap which uses a grid system to create mobile-friendly web pages.</p><p>Let’s dig into how it does that.</p><p>After pulling in our necessary libraries, Bootstrap uses a collection of classes to define various parameters. The grid-specific classes are best paired with <code>&lt;div&gt;</code> &amp; <code>&lt;span&gt;</code> tags; while it being important to note, tags can have multiple classes.</p><pre><code>&lt;div class=”col-lg-6 col-md-8 col-sm-12 col-xs-12”&gt;&lt;/div&gt;
</code></pre><p>Bootstrap operates off of a 12 block grid system with four adjustable display size categories: large, medium, small, extra-small.</p><p>In the previous line of code we said that we wanted the contents of that <code>&lt;div&gt;</code> tag to occupy six blocks on a large screen, eight blocks on a medium-sized screen, and 12 blocks, or the entire page, on smaller screens.</p><h2 id="css-more-in-depth-sass-less" tabindex="-1"><a href="#css-more-in-depth-sass-less">#</a> CSS More In-Depth (SASS/LESS) <a class="header-anchor" href="#css-more-in-depth-sass-less" aria-label="Permalink to “# CSS More In-Depth (SASS/LESS)”">​</a></h2><p>What is this all about? CSS Preprocessor language that is compiled into CSS.</p><p>Variables, mixins, etc --</p><p><a href="https://en.wikipedia.org/wiki/Sass*(stylesheet_language)" target="_blank" rel="noreferrer">https://en.wikipedia.org/wiki/Sass_(stylesheet_language)</a></p><p><a href="https://en.wikipedia.org/wiki/Less*(stylesheet_language)" target="_blank" rel="noreferrer">https://en.wikipedia.org/wiki/Less_(stylesheet_language)</a></p><h1 id="looking-ahead-to-mobile" tabindex="-1">Looking Ahead to Mobile <a class="header-anchor" href="#looking-ahead-to-mobile" aria-label="Permalink to “Looking Ahead to Mobile”">​</a></h1><hr><p>Back to the grid structure --- what are apps?</p><p><strong>Using an inspector.</strong> If you’re using Firefox or Chrome, right click on any browser window and choose the Inspect Element option.</p><p>In the upper bar of the new window that appears will be an option to toggle between full-screen and alternate view.</p><p>You can do this to see how the mobile friendly design you created using Bootstrap, will appear on various-sized screens.</p>`,107)])])}const b=a(i,[["render",l]]);export{g as __pageData,b as default};
