Vil du lære at oprette hjemmesider? Prøv vores gratis HTML & CSS crashkursus

Jeg er glad for at dele dette fire timers kursus om HTML og CSS med dig (<- link til kursus).

Hvis du er nysgerrig efter webudvikling, men ikke ved, hvor du skal starte, er dette det perfekte kursus for dig!

Der er absolut ingen forudsætninger for det, og du behøver ikke engang at installere en kodeditor! Scrimba dækker dig der.

Kursets instruktør er den strålende Kevin Powell. Han er en stor CSS-fan, en meget populær YouTube-instruktør, og han underviser også i HTML og CSS i klasselokaler. Med andre ord, du er i gode hænder.

I løbet af kurset skal du lære det grundlæggende i HTML og CSS og begynde at opbygge dine allerførste websider. Alle lektioner vil være praktisk og begynde at skrive den faktiske kode med det samme.

Når du har gennemført dette kursus og er klar til flere udfordringer, kan du også tjekke Kevin's responsive webdesign bootcamp. Det er et massivt 15-timers kursus, der lærer dig avanceret CSS, og hvordan man opbygger responsive websteder på et professionelt niveau.

Men indtil videre, lad os se nærmere på lektionerne i introkurset.

1. Introduktion

I den første lektion giver Kevin en lille introduktion til, hvad du kan forvente til kurset, og nogle tip til at lære så meget som muligt af det.

2. Hvad er HTML og CSS?

I den anden rollebesætning introducerer Kevin os til HTML og CSS, hvad disse akronymer står for, og hvordan både HTML og CSS er tæt sammenflettet.

3. Grundlæggende terminologi og syntaks

Kevin bruger en bog som et eksempel på, hvordan HTML-markering fungerer og introducerer sådanne begreber som elementsog tags, og hvordan man bruger dem.

4. Lad os skrive lidt HTML!

I denne screencast introducerer Kevin at lade browseren vide, at indholdet er HTML, og vi skriver vores første HTML-webside og lærer nogle grundlæggende elementer undervejs!

   My first website   

My very first webpage

Websites are built with HTML

HTML is a markup language that tells the browser what everything is

They also use CSS

I can't wait to start learning CSS!

5. strongogemphasis

Vi kan bruge til at lægge vægt på vores tekst og tilføje betydning .

6. Filnavngivelse og organisering

I denne del lærer Kevin os nogle gode fremgangsmåder omkring filnavne og giver gode råd om, hvordan vi organiserer vores filer.

7. Ankre og attributter

Vi kan bruge ankerelement til at linke til en anden placering på den samme side eller til en anden side. For at fortælle hvor vi skal linke, bruger vi det attributes, og til ankre er det href.

Link to Scrimba 

8. Introduktion til CSS

Kevin introducerer os til CSS-syntaks og forestillingen om egenskaber og værdier i CSS. Hvordan ved hjælp af property: valuesyntaks kan vi style vores websider og introducerer inline styling for at få individuelle elementer til at se godt ud på siden.

9. Grundlæggende om CSS

I denne video vil vi lære om skriftstørrelse, farver, baggrundsfarver og tekstjustering. Kevin vil introducere os til fire forskellige måder at specificere farver i CSS, ved hjælp af søgeord, hex, rgbog hslværdier.

10. Øv tid!

Ok, tid til nogle individuelle øvelser. Kevin sætter os en opgave med at oprette en side om os selv og sætter os nogle HTML / CSS-udfordringer undervejs.

11. Opsummer indtil dette punkt

I denne rollebesætning går vi hurtigt over alt, hvad vi har lært om HTML og CSS indtil dette tidspunkt. Gentagelse er moderen til at lære!

12. Lister

Now, Kevin shows us how to create lists in HTML using

    for ordered lists and
      for unordered lists.

      
              
      1. List item one
      2. a second list item
      • bullet point
      • another bullet
      ol and ul tags rendered to show the difference between the two

      13. Images

      Images are self-closing and both are valid . Kevin also explains how to use src and alt attributes and how alt helps improve accessibility.

      14. Practice time!

      Alright, time for our second practice screencast. Kevin sets us a challenge to convert some markdown files to HTML/CSS webpage. No worries if you're not sure what markdown is because in this practice session Kevin will walk us through the completion of the task.

      15. Internal CSS

      In this chapter, Kevin introduces internal CSS, an alternative to writing inline CSS.

      Internal CSS is written in the same file as HTML, but within a separate tag

         All about Earth and Mars  h1 { font-size: 60px; } p { font-size: 24px; color: steelblue; }    

      Earth and Mars

      Earth and Mars are two planets within our solar system.

      Rendered code above with styles applied

      16. External CSS

      External CSS is another approach to managing CSS. This time Kevin shows us how we can extract CSS into a separate file and how to link CSS stylesheets to our HTML files with a tag

      17. Classes and IDs

      In this screencast, Kevin focuses on three types of selectors in CSS and when you might want to use which.

      /* Element selector */ a { color: darksalmon; } /* Class selector */ .intro { font-size: 24px; } /* ID selector */ #earth-title { color: lightgreen; } 

      18. Comments in HTML and CSS

      We can add comments in HTML:

        Comments!    

      Comments!

      And in CSS:

      /* TODO: change the color of the text to white */ body { background: #333; color: white; } /* Some more comments */ h1 { color: red; } 

      19. The only tags you need to know (for now)

      In this part of the course, Kevin reminds us that we don't need to know everything at this point and at this stage we really need to know only the following tags:

      h1 -> h6 p strong and em a ul, ol, li img 

      And it would be good if we can tell the difference between the following tags:

      header main section footer nav div 

      20. Intro to the box model

      It's now time to discover the box model.

      Most elements are block elements, which means they are 100% width of their parent and have a height of 0.

      This is a brilliant cast, where Kevin not just simply and succinctly explains how the box model works, but also saves us from the common pitfalls that even experienced developers fall into from time to time.

      21. Margin and Padding

      Up next are margins and paddings.

      Margins are used to control the position of an element relative to those around it, while padding is used to control the positioning of content inside our element.

      Kevin does a great job explaining many different ways padding and margins can be set in CSS.

      /* */ padding-top: 20px; padding-right: 30px; padding-bottom: 40px; padding-left: 50px; /* Shorthand version would be */ padding: 20px 30px 40px 50px; margin-top: 500px; margin-left: 100px; margin-right: 100px; margin-bottom: 10px; /* Shorthand version would be */ margin: 500px 100px 10px; 

      22. Borders

      The last piece in the box model - borders. Borders are added around your elements. And they can be set in a similar way to margins and padding.

      border-color: yellow; border-width: 20px; border-style: solid; /* Shorthand version would be */ border: solid yellow 20px; 

      23. Box model wrap up

      In this chapter, Kevin helps us review CSS box model and provides a nice visualisation for future reference.

      Visualisation of the CSS box model

      24. A basic layout

      We are now ready to create a very basic layout.

      Example of page layout

      Kevin will guide us through creating a page about dinosaurs, where we will be able to put everything we've learned so far to practice.

      25. A basic layout - centring an element on the page

      In this chapter, Kevin shows us how to centre the main element. It's not too difficult, but there are a few tricky bits to it.

      Example of page layout with centred main element

      26. Creating columns with flexbox

      We are doing pretty well, so far.

      Over these last cast, Kevin introduces a mini-capstone project to create this HTML layout from scratch.

      Capstone project layout, the task

      Oftentimes, a lot of designs use columns in the footer. In this cast, Kevin shows us how to use display: flex to create this neat layout.

      Zoomed in footer, implemented using flexbox columns

      27. Creating the layout from scratch - the HTML

      In this screencast, Kevin slices the design into manageable pieces and walks us through the HTML implementation.

      Capstone layout with highlighted boxes around sections of the layout

      In this screencast, we are creating the HTML markup.

      The layout is written in just HTML

      28. Creating the Layout - The CSS

      And in the final part of this course, we're writing CSS to create the final layout.

      Capstone project layout, finished

      29. What's next?

      You rock! poster

      If you reach all the way to this cast, then give your self a pat on the back. Congratulations on finishing the course! We've covered a LOT, and you have every reason to be proud of yourself.

      Where can you go from here? Kevin's first recommendation is to install a text editor. Any of them at this stage would be good and you can always change later. VS Code is very popular and for a good reason.

      You should also keep an eye on Kevin's upcoming advanced course on how to build responsive websites, so be sure to sign up for Kevin's newsletter.

      Happy coding :)

      Thanks for reading! My name is Per Borgen, I'm the co-founder of Scrimba – the easiest way to learn to code. You should check out our responsive web design bootcamp if want to learn to build modern website on a professional level.