Should I change [a style] to [span style] or [div style] or should I leave it on [a style] and why?

Should I change [s style] to [span style] or [div style] or should I leave it on [a style] https://jsfiddle.net/81dnq0uy/

 <div style="width:596px" onclick="myq=document.getElementById('myquote'); myq.style.display='block';this.style.display='none'">

<a style="display:block; cursor: pointer; width: 603px; height: 66px; background-color:#000000; border: 1px solid #BF598E;padding-left: 1px"></a>
</div>

<div id="myquote" style="display: none;">

<div style="background-color:black; width: 605px; height:68px;padding-left: 1px">

<p style="display: table-cell;  font-family: New Times Roman; font-size: 16px;color: white; "><q>Never let society to turn you into a grain of sand on the beach. Be different, be individual. Refuse to look alike with others. Leave your herd, only then you will have a real name and till then your name will remain as the grain sand.</q> ~ <em>Mehmet Murat ildan</em></p></div></div>

If you want it to be a link, then keep the <a>. Otherwise, use something else.

As for all those inline styles … well, you know what we think of those. :‑###…

1 Like

I don’t want it to be a link so what should I change it to then? What should I change a to?

At the moment, there’s no content in it, so I’d say delete it altogether and replace it with nothing. If it’s just for some visual effect, you can just use the div container.

If you do find an actual purpose for it, let us know, and we can consider the actual semantics. }:‑)

What do you mean there’s no content in it, it works? https://jsfiddle.net/81dnq0uy/ Please elaborate.

The visual effect only works on [a style] which you say are meant for links or span style.

The <a> element is empty, so has no purpose. The setup works just the same if you remove the a and place its styles on the container div.

I apologize, you’re right, it does. https://jsfiddle.net/81dnq0uy/2/

<div style="display:block; cursor: pointer; width: 603px; height: 66px; background-color:#000000; border: 1px solid #BF598E;padding-left: 1px"></div></div>

And about inline styles, some sites only allow you to input html and nothing else.

But not this one, not jsFiddle, not CodePen …

Those are coding sites, I’m talking about regular sites, sites like Google sites, or Netvibes, those types.

Ah well, for what it’s worth, anything that doesn’t allow for proper code usage shouldn’t even be touched with a long, long pole. They’re just not in the game. You can get decent hosting for less that a cup of coffee per month, so I don’t really accept the argument that it’s too expensive, either. And there are nice options like GitHub Pages that you can use without dishing out $.

2 Likes

If you are going to use junk sites that don’t allow proper HTML then you should ask there how to write the junk that they require. Most people here would need the HTML and CSS to be written properly in order to be able to provide assistance as we don’t know what junk codes a particular junk code site expects you to use.

1 Like

Also netvibes expects code to be written using UWA (a flavor of XML) with external stylesheets so it doesn’t use HTML at all (not even a junk version).

1 Like

They have an html widget/gadget where you can post anything you want in it.

Including external CSS stylesheets?

https://uwa.netvibes.com/docs/Uwa/html/static-FAQ.html

Looks like that’s a YES.

So, I still want help getting that to work using html.

Getting what to work?

@ralphm has advised you to replace the <a> with something else, if it’s not a link. (The same advice I had already given you.) You say you’ve replaced it with a <div> and it works.

(And we’ve all told you multiple times not to use inline styles on any element. So far you’ve failed to provide a valid reason for persistently ignoring this.)

1 Like