Day 1/366
vishal.codes
Posted on April 1, 2024
π Today's Learning:
π DSA
- Static vs Dynamic Arrays
- Memory Allocation and Management
π DEV
- HTML - Elements and Semantic Tags
- CSS - Selectors, Box Model, Pseudo Classes
π Some Key Highlights:
Static arrays have a fixed size set at compile time, stored in either the stack or data segment. Access is super fast (O(1)) due to direct memory address calculation.
Dynamic arrays offer flexibility with size adjustment during runtime, managed via pointers and memory allocation functions like
malloc()
andnew
. But beware of memory leaks and undefined behavior!While dynamic arrays are powerful, they require careful memory management. Luckily, C++ provides safer alternatives like
std::vector
for automatic memory management and resizing.HTML is like the backbone of web pages, providing the structure and content.
There are various HTML elements like
<div>
,<a>
,<form>
, and<meta>
, each serving a unique purpose in creating web content.Understanding the
DOCTYPE
declaration ensures browsers render HTML correctly, like a passport guiding them through the document.The
semantic
HTML tagsΒ help the search engines and other user devices to determine the importance and context of web pages. The pages made with semantic elements are much easier to read.Examples ofΒ non-semanticΒ elements:Β
<div>
Β andΒ<span>
Β - Tells nothing about its content.Examples ofΒ semanticΒ elements:Β
<form>
,Β<table>
, andΒ<article>
Β - Clearly defines its content.CSS is like the stylist of the web, adding colors, layouts, and animations to HTML elements.
Selectors act like detectives, targeting specific elements for styling based on their tags, classes, or IDs.
The box model concept clarified how padding, margin, border, and content interact to define an element's appearance.
Pseudo-classes provide dynamic styling, allowing elements to change appearance based on user interaction. (e.g. a:hover)
Let's keep exploring and learning together! π Feel free to share your thoughts and experiences in the comments below. π
#1PercentPlusPlus #100DaysOfCode #LearningEveryday #LearnInPublic #Programming #Coding #DSA #SoftwareDevelopment
Posted on April 1, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.