Jump to content

New to coding and need help


FrustratedStudent

Recommended Posts

Hello! I just started taking my first html class, and I have NO prior experience with it. I'm having a problem getting my code to do what I want and I'm not getting any feedback from my instructor either (she won't give feedback until it's graded isn't that nice?). Anyway, I've looked all over and I'm not finding anything that really covers what I'm trying to do. I need to have some symbols change to a different color than the text, and then have some of the symbols go back to the original text color. The problem is that everything I have tried is giving me all or nothing. I *almost* got it to work once, but it put half of the symbols on a different line and I need them to stay next to each other.This is what I have (that doesn't work):<dt style="color: teal">★★</>< style="color: gray;">★★★</></dt> I get all teal stars with this. What am I doing wrong? Any help would be greatly appreciated!!

Link to comment
Share on other sites

<dt style="color: teal">★★</>< style="color: gray;">★★★</></dt>The bolded part is invalid. That first </> doesn't do anything and will probably be deleted by most browsers. The browser has no idea what < style='...'> is supposed to be so this probably also gets deleted. The <style> tag is used to create an embedded CSS stylesheet. (if you don't know what that is don't worry about it at this point. You will need to learn it eventually though). Try something like this:<dt style="color: teal">★★<span style="color: gray;">★★★</span></dt>

Link to comment
Share on other sites

Thank you!! That is exactly what I needed! I haven't learned anything about CSS yet, and the style tags are the only thing I could find that looked like they would work. There are so many little things to learn!
Just so you know, the style tag and style attribute are two entirely different things.The style tag is used for embedded CSS stylesheets:
<style type='text/css'>dt {   color: teal;}dt span {   color: gray;}</style>

The style attribute is used for embedding inline styles in an HTML element:<dt style='color: teal'>...<span style='color: gray;'>...</span></dt>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...