Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "css"


Style beautiful web pages without writing any CSS. Using W3.CSS.

  • And of course you can easily apply padding or margins, or even set a layout on the page that will help items fall into the right place.
  • The summary of it is: to any HTML element that you want to style, you need to add a class attribute.
  • Checkout the "W3.CSS" site for all these values and all the possible styling you can apply.
  • As you can see, the image (an img tag) and the text below it are placed inside a styled div.
  • The card div element also has a border, float location, padding, margin and background color specified (which i already described in the above elements).
  • For the text displayed right below the image, another div element is created to encompass it, of type w3-container.
  • Don't hesitate to check out the W3.CSS site for all the details and the options they offer for easily creating stylish web pages.

save | comments | report | share on


Building an animated sticky header with custom offset

  • With the appearance of the position: sticky property, we could create sticky elements without JavaScript plugins.
  • The task is to build a sticky header that appears when the user scrolls past the static header or on a custom offset position.
  • When scrolling down, the static header should stay at its place, while the sticky header should roll down.
  • When the user scrolls up and reaches the fake element in its new position, the sticky effect will be turned off.
  • I am aware the I could write better JS code and avoid adding the .fake-header element, but I wanted to create a demo without too many calculations.
  • Since the static header determines the height of the wrapper element, we have a problem with selecting or clicking on the content immediately after the sticky header, once it appears.

save | comments | report | share on


Using CSS Grid to create responsive web design

  • Now, elbows deep in React and using styled components, along with CSS grid, I find myself once again at the divide where queries would normally guide the way.
  • Luckily, CSS grid has handy tools, known as the auto-fill, and auto-fit properties which can alleviate some of these previously tedious tasks.
  • Here, i'm selecting the widths and dictating the specific row paddings and widths, which all works, and definitely makes the site more responsive, but recently working with react and having a page that works with grid, I came across auto-fit and auto-fill which made my life a lot easier.
  • So now, my row will have a minimum of 2 items (the max it can fit at 130px) or up to 10, as the window expands.
  • Now, with auto-foll it "fills the row with as many columns as it can fit".

save | comments | report | share on


3 Ways You Could Customize 3rd Party React Component

  • But as developers, you would often find yourself in situations where 3rd party components don't provide the functionality or customization capability the project needs.
  • But most of the time, customizing 3rd party component is the less time-consuming option.
  • As example, we are going to customize react-bootstrap-typeahead component.
  • This is where you could alter the default behavior of the 3rd party component.
  • Start by creating a wrapper component CustomizedTypeahead and replace Typeahead with it.
  • We are going to customize the component behavior by making changes to props.
  • It's actually not uncommon that one would have to modify a package's source code to fit a project's need.
  • In our example case, go to https://github.com/ericgio/react-bootstrap-typeahead and fork the repo to your own GitHub account.
  • After you fork the repo, your GitHub repo's URL should be https://github.com/<your GitHub username>/react-bootstrap-typeahead.
  • We talked about 3 ways to customize 3rd party React component.

save | comments | report | share on


3 Ways You Could Customize 3rd Party React Component

  • But as developers, you would often find yourself in situations where 3rd party components don't provide the functionality or customization capability the project needs.
  • But most of the time, customizing 3rd party component is the less time-consuming option.
  • As example, we are going to customize react-bootstrap-typeahead component.
  • This is where you could alter the default behavior of the 3rd party component.
  • Start by creating a wrapper component CustomizedTypeahead and replace Typeahead with it.
  • We are going to customize the component behavior by making changes to props.
  • It's actually not uncommon that one would have to modify a package's source code to fit a project's need.
  • In our example case, go to https://github.com/ericgio/react-bootstrap-typeahead and fork the repo to your own GitHub account.
  • After you fork the repo, your GitHub repo's URL should be https://github.com/<your GitHub username>/react-bootstrap-typeahead.
  • We talked about 3 ways to customize 3rd party React component.

save | comments | report | share on


Building an animated sticky header with custom offset

  • With the appearance of the position: sticky property, we could create sticky elements without JavaScript plugins.
  • The task is to build a sticky header that appears when the user scrolls past the static header or on a custom offset position.
  • When scrolling down, the static header should stay at its place, while the sticky header should roll down.
  • When the user scrolls up and reaches the fake element in its new position, the sticky effect will be turned off.
  • I am aware the I could write better JS code and avoid adding the .fake-header element, but I wanted to create a demo without too many calculations.
  • Since the static header determines the height of the wrapper element, we have a problem with selecting or clicking on the content immediately after the sticky header, once it appears.

save | comments | report | share on


Using CSS Grid to create responsive web design

  • Now, elbows deep in React and using styled components, along with CSS grid, I find myself once again at the divide where queries would normally guide the way.
  • Luckily, CSS grid has handy tools, known as the auto-fill, and auto-fit properties which can alleviate some of these previously tedious tasks.
  • Here, i'm selecting the widths and dictating the specific row paddings and widths, which all works, and definitely makes the site more responsive, but recently working with react and having a page that works with grid, I came across auto-fit and auto-fill which made my life a lot easier.
  • So now, my row will have a minimum of 2 items (the max it can fit at 130px) or up to 10, as the window expands.
  • Now, with auto-foll it "fills the row with as many columns as it can fit".

save | comments | report | share on


Coding with my wife

  • I always talk with my wife about my work as a Developer.
  • I have a dream, convince her to learn some programming language like Javascript.
  • So I convinced her to participate at #HourOfCode.
  • For this purpose I teached her how to change the facebook's page appearance.
  • We started with Html and then I explained her how to interact with the page using Javascript.
  • We used DevTool override feature to save our changes.
  • It was funny, at the end of the course she asked me if there are women that work as a Developer.
  • I replied her there are less women but many companies are working to reduce this gap around the world.
  • I promised her I will teach to code more often.
  • Maybe one day she will become a success developer.
  • Keep calm and code!
  • Coding couples rock!

save | comments | report | share on


Repl.it Multiplayer

  • Introducing Multiplayer: code with friends in the same editor, execute programs in the same interpreter, interact with the same terminal, chat in the IDE, edit files and share the same system resources, and ship applications from the same interface!
  • As part of our interview process at Repl.it (work with us) we have a phone screen where we hop on a Multiplayer session with a candidate and work on some coding problems together.
  • The fact that it's shared repl allows the interviewer to write test cases for the candidate's program to verify its validity.
  • We spent a lot of time trying to make the underlying system resources work in multiplayer mode because we think this feature, in the future, might transcend our websites and work with other IDEs and on different platforms.

save | comments | report | share on


Dev.to Review #11: Top 7 Of The Week, Discussed

  • In our first post, "How we reduced our initial JS/CSS size by 67%", Guilherme talks about his experience cutting frontend payload size for Fider, using techniques like code-splitting, lazy-loading, and moving to smaller dependencies.
  • Instead, we marvel at the idea that someone could actually take care of a baby, talk about games we've wanted to write, and how to fight multi-tasking.
  • Another Returning Champ, Jenn, walks readers through toxic behaviors she's seen in the workplace, her reflections with leaving fast and never looking back, and various red flags, in "My experience with toxic teams".
  • Malik and I discuss "Culture Anti-patterns", the meaning of the word "toxic", and what a Minimum Damaging Toxicity might look like.
  • We're still experimenting with post formats, audio, etc., so if you have any thoughts, feel free to let us know here, or on Twitter at @dangolant and @milkstarz.

save | comments | report | share on