+ 71
Designing and Styling
Hi,for designing and styling a web page,can we use JS instead of CSS? Which one is better(for styling)? does JS take CSS place?
55 Answers
+ 36
Yup, you can use js, but CSS is specially made for designing... And js is mainly used for animation and stuff ... js has the ability to design, because in small projects, adding a CSS file is a lot of work sometimes... But in Sololearn, using CSS is built-in with the web... And designing in js will make the code more complex to read... So prefer CSS over js for styling
And besides, won't CSS be sad if js does it's work? 😉😂😂
+ 34
Abolfazl Naseri you mentioned a good point. thx ☺
+ 27
I emphasize, just for design 😁
+ 24
Well yes you can use js but I think that CSS would be better.
CSS(cascading style sheets) has been made for styling . It has various instruments for creating animation , transitions and for stylings.
CSS is used to make the website look more attractive , more responsive .
Thanks
+ 24
Thx all, I wanted to start learning JS and I thought it can do CSS job better, so I decided not to practice CSS anymore 😂😁, thx again for saving me from laziness😉😊
+ 22
thanks all 😊
+ 15
You really should use css for styling and designing all the html elements. Css can be programmed through preprocessor such as sass/scss, less too, it allows you to add repeated blocks and modules, define maxin functions, assigned variables colors and sizes into css.
We only use javascript to add runtime logics on html elements.
+ 15
Don't use a hammer to do the job of a spanner.
+ 12
You can use css, css3, ZURB Foundation, Pure.CSS,
Semantic UI, UIkit, Materialize, Scalable and Modular Architecture for CSS (SMACSS)
+ 9
Why not use scss?
( js and css )
+ 8
A pure Designing is a combination of HTML + CSS + JS
but Mostly highly animation or Button on webpage are go through JS.
You can create a Beautiful Website with HTML and CSS (For Desinging Purpose only)
But for more responsive you have to choose JS.
+ 8
No it's can't take place because CSS is foundation of styling with this every design possible but js and other have limited library's ya js might be faster but CSS always good option for pure styling
+ 7
No. Acually JS can not replace CSS. JS has the capability of doing animations, but not in CSS. You can use jquery, which is easier than JS in handling animations.
+ 7
CSS is better.
If javascript is disabled in a browser, then your javascript won't render it.
+ 6
You can!
+ 6
Then teach us css
+ 6
Js used to make the behavior of a webpage i think css is more attractive
+ 6
No need to be ambivalent, as you've stressed "designing and beautification"...CSS is your guy.
Soon enough, you'll love some interactivity on your page, that's when JS comes out handy.
+ 5
You ask a good question. What I understand is that the simple answer is no. When I have used JS to stir style a page, it has typically been by adding CSS elements or even HTML attributes. JS added the functionality to my pages. I'm guessing that you wouldn't really ever see JS without CSS.
+ 5
use CSS and keep in mind that JS ist blocked or disabled. USe JS a less as possible.