majadc.com

css, html, javascript

  • Home
  • CSS
  • Snippets
  • Notes
  • GitHub
Skip to content

Snippets

  • The Sticky Header & Footer

    Why sticking The layout has the header and the footer elements that they do not scroll with the page. The sticking behavior is achieved by applying the CSS property “position: sticky” to these elements. By setting the values “top: 0” for the header and “bottom: 0” for the footer, the elements are positioned at the […]

    Read more

    Posted in Snippets

  • box-sizing

    Using universal border-box sizing. Every element will inherit the box-sizing from their parent. In case third-party components will have box-sizing: content-box, using the inherit keyword will make the conversion easier.

    Read more

    Posted in Snippets, Web

  • svg – use

    The <use> element takes nodes from within the SVG document, and duplicates them somewhere else. Resources MDN

    Read more

    Posted in Snippets, Web

  • Detect window scrollbars

    Clean JavaScript to detect if the window has a scrollbars.

    Read more

    Posted in JavaScript, Snippets

  • Flex – margin: auto

    The CSS rule margin: auto; centers the flex children horizontally and vertically.

    Read more

    Posted in CSS, Snippets

  • Media query – breakpoints

    Creating breakpoints for @media query using @mixin scss.

    Read more

    Posted in Snippets

  • The grid system – float and clearfix.

    Grid Layout consists of 12 columns based on floats.

    Read more

    Posted in Snippets

  • Gradient Text

    Snippet for gradient text.

    Read more

    Posted in Snippets

  • using vw for font size

    Setting font size in vw units using the cacl() function.

    Read more

    Posted in Snippets

  • Centering vertically

    Centering vertically text using line-height See the Pen Vertical centring – text -line-height by majadc (@majadc) on CodePen. Centering vertically image using span element See the Pen Centering vertically using span by majadc (@majadc) on CodePen. Centering vertically image using flex box. See the Pen Centering vertically – flexbox by majadc (@majadc) on CodePen. Centering […]

    Read more

    Posted in CSS, Snippets

  • Posts navigation

    Older posts
  • Proudly powered by WordPress
  • majadc.com
  • Privacy Policy

We do not collect any personal data. The website does not require registrations. We may use cookies in order to save yours preferences for future visits. If you decide to disable cookies in theirs browser it will not affect your experience. We use third party services like Google Analytics and WP Statistic for functionality and to better understand user interaction with the website.Google Analytics, which places a cookie on your device, to obtain information on how you engage with this website. WP Statistic stores information like: user agent and platform, user IP, user country, search engines, referring websites.