Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,801 members, 7,810,086 topics. Date: Friday, 26 April 2024 at 08:25 PM |
Nairaland Forum / Science/Technology / Webmasters / A Lil CSS Quiz (1038 Views)
Most Confusing And Simple Maths Quiz / How To: Create A Simple Hover Button With Html And Css / A Lil Help Plz. How Do I Patent My New Web Application? (2) (3) (4)
A Lil CSS Quiz by yawatide(f): 6:15pm On May 21, 2013 |
If it is at all possible, how can the below code be made better?
|
Re: A Lil CSS Quiz by GraphicsPlus(m): 6:47pm On May 21, 2013 |
For newbies? |
Re: A Lil CSS Quiz by yawatide(f): 7:28pm On May 21, 2013 |
For newbies, all those who think they are experts but are actually newbies in disguise and all those who are constantly in pursuit of knowledge |
Re: A Lil CSS Quiz by spikesC(m): 7:40pm On May 21, 2013 |
What is your definition of better? Code reduction? |
Re: A Lil CSS Quiz by yawatide(f): 7:43pm On May 21, 2013 |
Hmmm, More efficient; more maintainable; easier to read, follow and understand. Do you now understand or do you want me to say more? |
Re: A Lil CSS Quiz by PrinceNN(m): 8:00pm On May 21, 2013 |
unnecessary repetition of similar styles could be optimized by using reusable classes
|
Re: A Lil CSS Quiz by yawatide(f): 9:00pm On May 21, 2013 |
^^^ Very good! |
Re: A Lil CSS Quiz by Nobody: 9:26pm On May 21, 2013 |
To me, this will solve the problem:
Not this: ₱®ÌИСΞ: This is because one will have to create an outer div before an inner div for the second format. I.e <div class="common"> <div class="box"> </div> </div> That is too much code. But with the first one, you write less and achieve more because they all inherit a general property from the first set of general declarations. Thank you. |
Re: A Lil CSS Quiz by mashnino(m): 10:11pm On May 21, 2013 |
^^ I think the other code is okay.. You don't need to create an outer div to solve the problem you can combine to class in one div like dis <div class=box common"> and you are fixed... But urs is also good too... |
Re: A Lil CSS Quiz by Nobody: 10:17pm On May 21, 2013 |
^^^ yeah... I just remembered. Gud one, though. @OP...Can we have more of this often??... I think this can help increase people's participation on the webmasters section. |
Re: A Lil CSS Quiz by spikesC(m): 10:19pm On May 21, 2013 |
Both answers are correct. But with experience and id names, we can assume that there will be more than 1 item, so we would go with the 1st answer. Which was the reason i asked yawas her definition of better. The code can still be stripped down, spacing and code wise. |
Re: A Lil CSS Quiz by HausofDinma: 2:03am On May 22, 2013 |
Maybe it's better if you test folks using a live installation. You can use use Code Pen http://codepen.io/ That way one can change things on the fly and see results. Otherwise na just trial and error una dey do! Peace |
Re: A Lil CSS Quiz by spikesC(m): 2:37am On May 22, 2013 |
Smh |
Re: A Lil CSS Quiz by solid3(m): 7:57am On May 22, 2013 |
No time, just passing. |
Re: A Lil CSS Quiz by mitey(m): 9:17am On May 22, 2013 |
Haus of Dinma: Maybe it's better if you test folks using a live installation. You can use use Code Pen http://codepen.io/ That way one can change things on the fly and see results. Otherwise na just trial and error una dey do! Just wondering, why not simply use the firebug extension for Firefox? |
Re: A Lil CSS Quiz by HausofDinma: 2:39pm On May 22, 2013 |
Think of Code Pen as a hosted version of firebug.Code Pen is designed to be collaborative. Throw your CSS, HTML and JavaScript code up there and folks can experiment and see results in real time. |
Re: A Lil CSS Quiz by yawatide(f): 9:28pm On May 22, 2013 |
Folks, Both answers are correct (there are 1001 ways to skin a cat) but the very first answer is preferred...Think reuse. If you have IDs, then it can only be used once. It thus potentially becomes tied to that particular element. If you make them classes (and separate the common elements into 1 class), you can better reuse the code. It is more code upfront but in the long-term, it is more efficient. Makes more sense if you run a very big website with tons of hits per day. This concept is called OOCSS (Object-Oriented CSS). In general, my rule of thumb has always been, "if you find yourself using the same code, irrespective of language, more than once, that's a candidate for abstraction". I have definitely enjoyed the banter. If you want more like this, let me know. I can come up with more, not just in CSS, but other languages as well 1 Like |
Re: A Lil CSS Quiz by HausofDinma: 10:47pm On May 22, 2013 |
^^^ Sounds like an ad |
Re: A Lil CSS Quiz by yawatide(f): 9:52am On May 23, 2013 |
^^^ he he, it is. OOCSS and RWD are the new technologies and unlike the others, these are forward-looking and recognize the need for a "one web", which is the way everything is going...well, at least, I guess, till someone else comes up with another catchy phrase. Make i Stop here as even I am beginning to think this response also sounds like an ad |
Re: A Lil CSS Quiz by mashnino(m): 1:23pm On May 23, 2013 |
@yawa dnt mind dem... Abeg continue teachin us so dat we wuld learn more from u guys... |
Re: A Lil CSS Quiz by yawatide(f): 4:35pm On May 23, 2013 |
^^^ I will come up with something else in due time |
(1) (Reply)
Full Biography Of Ayodeji Ibrahim Balogun A.k.a Wizkid / how can i buy domain from wordpress in nigeria / Steps In Getting A Free Or Paid Webhost FOR NEWBIES
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30 |