Click here to Skip to main content
15,887,027 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: .Net Framework vs .Net 5 Core Pin
#realJSOP14-Dec-20 2:42
mve#realJSOP14-Dec-20 2:42 
GeneralRe: .Net Framework vs .Net 5 Core Pin
zezba900015-Dec-20 8:16
zezba900015-Dec-20 8:16 
RantRe: .Net Framework vs .Net 5 Core Pin
Marc Clifton6-Jan-21 11:42
mvaMarc Clifton6-Jan-21 11:42 
GeneralRe: .Net Framework vs .Net 5 Core Pin
Super Lloyd1-Feb-21 19:08
Super Lloyd1-Feb-21 19:08 
GeneralRe: .Net Framework vs .Net 5 Core Pin
Chris Maunder5-Feb-21 14:04
cofounderChris Maunder5-Feb-21 14:04 
GeneralRe: .Net Framework vs .Net 5 Core Pin
#realJSOP7-Feb-21 10:01
mve#realJSOP7-Feb-21 10:01 
GeneralRe: .Net Framework vs .Net 5 Core Pin
Chris Maunder7-Feb-21 10:17
cofounderChris Maunder7-Feb-21 10:17 
GeneralCSS: [ ] selector Pin
raddevus4-Dec-20 5:16
mvaraddevus4-Dec-20 5:16 
Trying to tighten up my CSS skills so I'm reading, CSS: The Definitive Guide[^] (4th ed) O'Reilly pub., and I learned something about CSS selectors I've never seen before.

If you have only a bit of CSS knowledge (like me) then you probably know you can create :
1) id selectors (indicated by # symbol)
HTML
#mainThang{color:blue;border: 5px solid red;}
<div id="mainThang>This my example.</div>
2) class selectors (indicated by . symbol)
HTML
.articleTitle {font-size:xx-large;color:red}
<div class="articleTitle">This Explains Everything</div>

All Elements With An Attribute
But, did you know you could select all elements that have a particular attribute?
For example you can select every img element on your page that has an alt tag on it.
Obviously, if the img doesn't have that attribute it isn't chosen.
You use [ ] brackets to indicate the attribute of the element:
CSS
img[alt] {border: 3px solid red;}
<img alt="elephant pic" src="fakeUrl.png">
<img alt="bird pic" src="fakeUrl2.png">
<img src="fake_unknown.png">

The first two images would get the style applied, but the last one wouldn't.
I like learning. Learning's my favorite. Smile | :)
GeneralRe: CSS: [ ] selector Pin
  Forogar  4-Dec-20 5:26
professional  Forogar  4-Dec-20 5:26 
GeneralRe: CSS: [ ] selector Pin
raddevus4-Dec-20 8:55
mvaraddevus4-Dec-20 8:55 
GeneralRe: CSS: [ ] selector Pin
  Forogar  7-Dec-20 4:24
professional  Forogar  7-Dec-20 4:24 
GeneralRe: CSS: [ ] selector Pin
raddevus7-Dec-20 5:00
mvaraddevus7-Dec-20 5:00 
GeneralRe: CSS: [ ] selector Pin
Richard Deeming4-Dec-20 6:32
mveRichard Deeming4-Dec-20 6:32 
GeneralRe: CSS: [ ] selector Pin
raddevus4-Dec-20 8:56
mvaraddevus4-Dec-20 8:56 
GeneralRe: CSS: [ ] selector Pin
kapalmuks<329-Aug-21 21:00
kapalmuks<329-Aug-21 21:00 
GeneralRe: CSS: [ ] selector Pin
BabyYoda4-Dec-20 7:24
BabyYoda4-Dec-20 7:24 
GeneralRe: CSS: [ ] selector Pin
raddevus4-Dec-20 8:57
mvaraddevus4-Dec-20 8:57 
GeneralRe: CSS: [ ] selector Pin
Mike Hankey10-Dec-20 6:34
mveMike Hankey10-Dec-20 6:34 
GeneralRe: CSS: [ ] selector Pin
raddevus10-Dec-20 9:12
mvaraddevus10-Dec-20 9:12 
GeneralRe: CSS: [ ] selector Pin
Marc Clifton10-Dec-20 12:43
mvaMarc Clifton10-Dec-20 12:43 
GeneralRe: CSS: [ ] selector Pin
Phil Boyd11-Dec-20 2:29
Phil Boyd11-Dec-20 2:29 
GeneralFor your consideration Pin
Gary R. Wheeler11-Nov-20 3:43
Gary R. Wheeler11-Nov-20 3:43 
GeneralRe: For your consideration Pin
raddevus11-Nov-20 3:56
mvaraddevus11-Nov-20 3:56 
GeneralRe: For your consideration Pin
Mircea Neacsu11-Nov-20 4:28
Mircea Neacsu11-Nov-20 4:28 
GeneralRe: For your consideration Pin
Gary R. Wheeler11-Nov-20 5:01
Gary R. Wheeler11-Nov-20 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.