So first of all, I'm posting this here because I wasn't sure where else to put. I chose here since the site I'm currently developing is a wordpress blog, so it seemed like the right choice.
First of - Here's the link to the page: http://www.kirschfamilycomputerservices.com/sam/wheresthefairness/#
Now, here's what I want to know. Note the links to posts under the "Most Recent Cases" header. What I want is for the entire li section to be highlighted in red when you hover over a link, not just the link itself. Why? No huge reason. I just think it will look cool, but I've really got no idea how to make it work.
So here's the code
The PHP/HTML
<div id="posts"> <?php $temp_query = $wp_query; ?> <?php query_posts('cat=0&showposts=8'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $do_not_duplicate[$post->ID] = $post->ID; ?> <li><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a><span class="date"> at <?php the_time();?></span></li> <?php endwhile; else: ?> <?php endif; ?> </div>
The CSS
#posts { width: 620px; float: left; border-bottom: 1px dotted #f2f2f2; margin-left: -20px; } #posts a:link {color: #000000; font-weight: bold;} #posts a:visited {color: #000000; font-weight: bold;} #posts a:hover {background-color: #CC0000; color: #000000; font-weight: bold; width:630px;}
Thanks in advance for any help on this little conundrum
Wow, I really cannot figure
Wow, I really cannot figure out how to edit this post...
I left part of the CSS out -
#posts li { border-top: 4px solid #f2f2f2; border-right: 4px solid #f2f2f2; list-style-type: none; }
It might help to clarify what
It might help to clarify what you mean by 'List Section' and hover which anchors? although looking at your loop it's just a series of category posts links? so each li element simply contains the permalink post title? if so and you wanted to hover the anchor text and have the actual li element background changed then you would set the anchor to display:block so that it would fill it's parents dimensions.
On the other hand if you want to higlight say the whole block i.e ul parent then CSS does not provide for transversal back up the DOM it can only apply styles in a forward direction or flow, scripting can provide a solution, by using jQuery (available by default with WP) you can make use of it's xpath capabilities and do something that says 'for this element do this action on it's parent' so you could add a class on hover of the anchor to it's parent and style that class.
btw your markup or script looks incorrect as it doesn't appear to provide a ul parent for the looped li items.
Thank you very much! Setting
Thank you very much! Setting the display to block worked like a charm. There are no UL parents for a reason, but it's a long and convoluted reason so just trust me. My motto: If it looks good and doesn't break anything - It's not wrong.
Also my apologies if I lacked some clarity, re-reading the post, it was a bit cryptic. I've been cramming in some last minute work for clients so that everyone can have a nice X-Mas vacation! Unfortunately this leads to a lot of sleep deprivation and too much caffeine, which has a tendency to affect your articulation.
However thanks again for the quick response and perfect solution, have a very merry Christmas!
:0 hmmmmmm it's Christmas so
:0 hmmmmmm it's Christmas so I wont push the issue
Sallana wrote: My motto: If
My motto: If it looks good and doesn't break anything - It's not wrong.
:0 hmmmmmm it's Christmas so I wont push the issue
I will, because that's a horrible motto. Probably one of the worst I've ever heard.
You might as well have the motto "I'm really bad at my job, but I hide it from those who don't really understand what I do, so they never complain."
Take pride in your work.
First of all - It was a
First of all - It was a light-hearted joke, hence the ":p"
Secondly - I have about 15 clients and 30,000$ just from the past 5 months to prove I'm not horrible at my job.
And lastly, obvious troll is obvious
Wow
Making good money girl, I'm impressed but then I'm not a "Guru"
Sallana wrote: First of all -
First of all - It was a light-hearted joke, hence the ":p"
Secondly - I have about 15 clients and 30,000$ just from the past 5 months to prove I'm not horrible at my job.
And lastly, obvious troll is obvious
Sorry. I don't take my profession lightly. I'm pretty serious about what I do and how I provide for my family.
Also, as I mentioned, you might just be good at hiding these issues from your clients, so they keep paying, not knowing any better. I don't really care how much money you make by lying to your clients.
Lastly, you're the one who came here bragging about all the money you make by ripping off your clients... not sure how that makes me the troll?
I'm not entirely sure what
I'm not entirely sure what issues you're talking about. None of the websites I provide are set to explode. They all work perfectly and are tested thoroughly. All follow WWWC standards. The UL opening and closing tags are nested in a separate part of the code. If you can't make light of something, don't bother to live.
regia wrote: Making good
Making good money girl, I'm impressed but then I'm not a "Guru"
Wordpress, Joomla, and other CMS's are VERY sought after nowadays. Spend some time learning your way around these things, and clients will pay big bucks. And it's mostly just styling the page to look the way they want, and using plug-ins to generate whatever backend utilities they require. You very rarely have to stick your hand in any real PHP or scripts, and it's rather lucrative. I'm sure the well will run dry eventually, but then you just learn the next big thing. Don't be impressed, really. My husband grew up in the rich part of Manhattan, his dad was some big-shot doctor so he's got a lot of connections. I'm nothing to be impressed over, I'm just lucky.
It's who ya know. Ya know?
Sallana][quote=regia
Wordpress, Joomla, and other CMS's are VERY sought after nowadays. Spend some time learning your way around these things, and clients will pay big bucks.
And you will be, and are, part of the problem. And part of the reason most web pages suck. If you feel good for taking money for that, then we come from different cultures and I suggest you find a different forum where they will tell you how wonderful and wise you are, instead of the truth you will get here.
I mean, this isn't exactly a
I mean, this isn't exactly a 'noble' profession. No ones lives depend on the base we use to design our websites. The fact that you are so arrogant when it comes to something so futile is quite frankly the most pathetic thing I have ever seen. I go where the money is. That's the point of having a job.
Sallana wrote: I mean, this
I mean, this isn't exactly a 'noble' profession. No ones lives depend on the base we use to design our websites. The fact that you are so arrogant when it comes to something so futile is quite frankly the most pathetic thing I have ever seen. I go where the money is. That's the point of having a job.
I think we will disagree about who is the most pathetic person here.
(No subject)
Please everyone
Lighten up, it's the Christmas season! Let a little holiday spirit and cheer lighten our lives, there is enough strife, poverty, war and hunger. Could a mod please close down this post, it is really going nowhere, except steadily downhill.
regia wrote: ... Could a mod
... Could a mod please close down this post, it is really going nowhere, except steadily downhill.
Second.
Calling time on this thread
Calling time on this thread now. No further comments unless they are constructive and about coding, Thanks.
I'm constructive! Well, I am.
@ the OP:
The problem with the markup is that the syntax is broken, and the structure of a list is malformed. That may work every time for you, but it is just as liable to grow big teeth and latch onto your hind-quarters. It would serve you well, and if done in the course of the work, cost you little or nothing, to be sure your markup is valid, well structured and semantic.
Also, please don't respond to ad hominem arguments.
@ Ed and deuce:
OK, younguns. (Yes, Ed, I know you're an old fart like me.) Both of you are making puerile ad hominem attacks on the OP that are completely unnecessary and undesirable on the forum. Please stop it. I understand your disagreement with the OP's statement, but a more calm and rational, non-confrontational argument could have been made.
cheers,
gary
Yeah, I mean.. Thanks for
Yeah, I mean.. Thanks for backing me up and all. I appreciate it and I appreciate the advice. I've just begun my journey into my career, so mistakes are made. However, I came here to ask a simple question about a hover style, which was answered, and through a meaningless joke I was attacked relentlessly... Because, I make a lot of money.
The hostility shown here over the fact that I've been learning to master the CMS world is just absolutely crazy. I don't know if you people think that I CAN'T build a website from the ground up, or if you're just jealous because I'm more lucrative than you. Or if you think I'm taking the easy way out. But I CAN build a website using nothing but notepad and photoshop(www.kirschfamilycomputerservices), and I'm not taking the easy way out.
CMS's are desirable for clients because they don't know how to code. So if something on the website needs to be updated or changed, they have to get a friend who knows what they're doing, or keep their website designer on hand. With a CMS, you create a website with many modules and plug-ins which will allow your client to have more control over their website without having to know what they are doing, and in a pleasing and easy to navigate environment.
I've seen no examples of how Wordpress and Joomla or other CMS software are destroying the industry of website design, other than allowing people who don't know how to design a website, to create one rather easily without having to know how to code.
So are you butthurt about it because you think it's something similar to having a robot take your job away? Or are you just not keen on learning the new technology? Either way the consensus is still that you're pathetic.
For the record, CSS "gurus" you can use the <li>
tag on its own if you style it. By doing that, you're simply using it as a generic tag to style, and if you're good enough, you can remove any markup that might cause an issue. But as I've already said, the <ul>
parents are present in the code, I simply didn't display that part of the code. That got ignored so you ravenously attack me personally like starved raptors.
There was nothing WRONG with my code. I came here because I simply wanted to know how I would use CSS to style an anchor which would fill it's parent. My code wasn't broken, there was no issue. I could have just as easily googled it and figured it out in 20 minutes on my own, but when this site came up in google, I thought it was a good opportunity to meet some nice people and get involved in a cool community.
There are probably nice people here. This Gary guy seems kind enough. But I see no reason to spend any more time here, if every post I make is just going to be attacked by over-jealous and insecure children.
Anyway, flame me all you want, I really don't care. In the end I've still got a good paying job, a healthy kid and a great husband, and there are better places to waste my time.
Cheers.
*sigh*
*sigh*
Eh hem
I did ask for this post to be closed down because it was becoming inflammatory and totally unproductive. It should have been, this could go on forever >)
Please let's close this one down.
No regia it won't go on for
No regia it won't go on for ever and I am now closing it as it has run it's course. Closing threads is always a last resort, I asked that if it were to continue it continued along firm coding lines only, however Sallana's last right to reply was fair enough comment; and I see that as the natural conclusion to the thread.
@Sallana sorry your first experience of the forum wasn't the best but it's not utterly indicative of the normal experience so hope you stick around.
This Gary guy seems kind enough
Oh don't be fooled, wolf in sheeps clothing that Gary is, however I'm quite kind
Thread now closed.