Should Wrap be on all these CSS classes, or should Links be on all of them?

I have a question if someone can help me with this.

Should wrap be on all these classes, or should links be on all of them?

@Ray.H

or Should both be used?

Which would you say to use, and why?

On the other code:

nav was placed only on these:

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <ul class="nave">


.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}

Would this div class be the equivalent of nav?
Which is how @PaulOB had originally set it up. #182


  <div class="linkse">
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>

<div class="linkse">

.linkse {
  margin: 0;
  padding: 0;
}

.linkse a {
  float: left;
}

If this would be the case, then this would point to the 3rd Way I listed on here.


1st Way


<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <div class="linkse">

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.linkse a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.linkse a:hover {
  border: 3px solid red;
}

.linkse a:nth-of-type(5n) {
  margin-right: 0;
}

.linkse a:nth-of-type(8) {
  opacity: 0;
  border: none;
  background: none;
}

.linkse a:nth-of-type(15) {
  position: relative;
  height: 50px;
  width: 50px;
  background: none;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.linkse {
  margin: 0;
  padding: 0;
}

.linkse a {
  float: left;
}

2nd Way:
https://jsfiddle.net/jq18evLs/81/

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <div class="linkse">

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrape a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape a:hover {
  border: 3px solid red;
}

.wrape a:nth-of-type(5n) {
  margin-right: 0;
}

.wrape a:nth-of-type(8) {
  opacity: 0;
  border: none;
  background: none;
}

.wrape a:nth-of-type(15) {
  position: relative;
  height: 50px;
  width: 50px;
  background: none;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape {
  margin: 0;
  padding: 0;
}

.wrape a {
  float: left;
}

3rd Way Uses Both
https://jsfiddle.net/jq18evLs/85/

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <div class="linkse">

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrape a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape a:hover {
  border: 3px solid red;
}

.wrape a:nth-of-type(5n) {
  margin-right: 0;
}

.wrape a:nth-of-type(8) {
  opacity: 0;
  border: none;
  background: none;
}

.wrape a:nth-of-type(15) {
  position: relative;
  height: 50px;
  width: 50px;
  background: none;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.linkse {
  margin: 0;
  padding: 0;
}

.linkse a {
  float: left;
}

In the code here I just changed links to nav.
https://jsfiddle.net/jq18evLs/104/

<div class="wrape">
  <div class="covere" title="OPEN"></div>

  <div class="nav">
   <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>



.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrape a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape a:hover {
  border: 3px solid red;
}

.wrape a:nth-of-type(5n) {
  margin-right: 0;
}

.wrape a:nth-of-type(8) {
  opacity: 0;
  border: none;
  background: none;
}

.wrape a:nth-of-type(15) {
  position: relative;
  height: 50px;
  width: 50px;
  background: none;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav {
  margin: 0;
  padding: 0;
}

.nav a {
  float: left;
}

I think I have settled on this one.

3rd Way

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrape a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape a:hover {
  border: 3px solid red;
}

.wrape a:nth-of-type(5n) {
  margin-right: 0;
}

.wrape a.ap {
  opacity: 0;
  border: none;
  background: none;
}

.wrape a.sh {
  position: relative;
  background: none;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav {
  margin: 0;
  padding: 0;
}

.nav a {
  float: left;
}
<audio></audio>

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <div class="nav">
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a class="ap"> Audio Player</a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a href="" target="_blank" title=""></a>
    <a class="sh" href="http://hi5.1980s.fm/played.html" target="_blank" title="Song History">
      <div class="left-background"></div>
      <div class="left-border"></div>
      <div class="middle-background"></div>
      <div class="right-border"></div>
      <div class="right-background"></div>
    </a>
  </div>

  <div class="playButtone" data-audio="http://hi5.1980s.fm/;">

    <svg class="playe hide" focusable="false" width="38" height="40" viewbox="0 0 85 100">
      <path d="M81 44.6c5 3 5 7.8 0 10.8L9 98.7c-5 3-9 .7-9-5V6.3c0-5.7 4-8 9-5l72 43.3z">
      </path>
    </svg>

    <svg class="pausee hide" focusable="false" width="36" height="40" viewbox="0 0 60 100">
      <path d="M0 8c0-5 3-8 8-8s9 3 9 8v84c0 5-4 8-9 8s-8-3-8-8V8zm43 0c0-5 3-8 8-8s8 3 8 8v84c0 5-3 8-8 8s-8-3-8-8V8z">
      </path>
    </svg>
  </div>
</div>

Seriously? After all the time members have spent (wasted, it seems), explaining best practice for structuring your HTML, you’re going back to a version with the text as an image, not real text, the links in a <div>, not a <ul> and multiple needless empty <div> s for display purposes only? You seem to have taken a perverse delight in using every technique you were advised against.

Although I don’t know why I’m surprised, as you have continually ignored sound advice.

2 Likes

So why not just use the working version?
#112

This is the working version, Blogger breaks the other version.

Then fix the other version, rather than just throwing up your hands and saying “it can’t be done”.

It can’t be done, and when I found that out, just a little bit ago, I was not happy.

Why not? What’s the problem?

You’ll forgive me being sceptical, but for a long time you insisted that only inline styles could be used in Blogger, and we know that was incorrect.

You’ve never explained, either, why you must use Blogger, despite its limitations.

3 Likes

Yes, WHY do you insist on using Blogger? That has been a long-standing, never-explained mystery.

Why Blogger?

2 Likes

Most likely because you haven’t learned the css we have been teaching you and haven’t accounted for the cascade or for global styles all of which are easily rectified.

4 Likes

I got it working on blogger thanks to @Ray.H

Question 1:
Did I have the class names placed correctly here though?

I want to know If I was doing it right there.

#2

Which would be the equivalent of this, right?

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <ul class="nave">


.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrape a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrape a:hover {
  border: 3px solid red;
}

.wrape li:nth-of-type(5n) a {
  margin-right: 0;
}

.wrape li:nth-of-type(8) a {
  opacity: 0;
}

.wrape li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.nave {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nave li {
  float: left;
}

Question 2
@PaulOB

How did you choose for the last 2 class names to be .nav, and all the others to be .wrap?

<div class="wrap">
  <div class="covere" title="OPEN"></div>
  <ul class="nav">


.wrap {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.wrap a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.wrap a:hover {
  border: 3px solid red;
}

.wrap li:nth-of-type(5n) a {
  margin-right: 0;
}

.wrap li:nth-of-type(8) a {
  opacity: 0;
}

.wrap li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}:

How come you didn’t make them all .nav, instead of .wrap?

Making them all .nav like this:


.wrap {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.nav a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav a:hover {
  border: 3px solid red;
}

.nav li:nth-of-type(5n) a {
  margin-right: 0;
}

.nav li:nth-of-type(8) a {
  opacity: 0;
}

.nav li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}:

It would make more sense to be .nav as in your second example.

I can’t remember why wrap was used but was probably a leftover from a previous version.

1 Like

Thank you, I will make that correction now.

I’m readjusting the CSS now.

How would you position these classes now, from 1st, to last?

Shouldn’t this now be at the top, towards the top of the CSS?

Instead of towards the bottom.


.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}

And cover should now be under wrap:

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.covere {
  width: 266px;
  height: 174px;
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
  cursor: pointer;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.covere {
  display: none;
}

.inactivee .covere {
  display: block;
}

.covere::before,
.covere::after {
  content: "";
  position: absolute;
  top: 0;
  left: 86px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.covere::after {
  left: 177px;
}

I’m readjusting this

.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.nav a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav a:hover {
  border: 3px solid red;
}

.nav li:nth-of-type(5n) a {
  margin-right: 0;
}

.nav li:nth-of-type(8) a {
  opacity: 0;
}

.nav li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.left-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: rgba(0, 255, 255, 0.5);
}

.left-border {
  position: absolute;
  top: 0;
  left: 12px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.middle-background {
  position: absolute;
  top: 0;
  left: 15px;
  width: 14px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
}

.right-border {
  position: absolute;
  top: 0;
  left: 29px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.right-background {
  position: absolute;
  top: 0;
  left: 32px;
  width: 12px;
  height: 100%;
  background: rgba(255, 0, 255, 0.5);
}

.inactivee a {
  display: none;
}

.inactivee .playButtone {
  display: none;
}

.covere {
  width: 266px;
  height: 174px;
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
  cursor: pointer;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.covere {
  display: none;
}

.inactivee .covere {
  display: block;
}

.covere::before,
.covere::after {
  content: "";
  position: absolute;
  top: 0;
  left: 86px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.covere::after {
  left: 177px;
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}

.activee .playButtone {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, .7);
  cursor: pointer;
  fill: #aaff00;
}

.activee {
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}

.playe,
.pausee {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 6px;
  margin: auto;
}

.pausee {
  left: 0;
}

.hide {
  display: none;
}

Since I will be staying with this structure, I would want the CSS to be positioned in a good way.

Since I changed the other multiple .wraps to .nav, that puts everything out of order.

How would you position the classes now?
@PaulOB

Something like this?

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <ul class="nav">
    <li>
.wrape {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.covere {
  width: 266px;
  height: 174px;
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
  cursor: pointer;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.covere {
  display: none;
}

.inactivee .covere {
  display: block;
}

.covere::before,
.covere::after {
  content: "";
  position: absolute;
  top: 0;
  left: 86px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.covere::after {
  left: 177px;
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}

.nav a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav a:hover {
  border: 3px solid red;
}

.nav li:nth-of-type(5n) a {
  margin-right: 0;
}

.nav li:nth-of-type(8) a {
  opacity: 0;
}

.nav li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.left-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: rgba(0, 255, 255, 0.5);
}

.left-border {
  position: absolute;
  top: 0;
  left: 12px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.middle-background {
  position: absolute;
  top: 0;
  left: 15px;
  width: 14px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
}

.right-border {
  position: absolute;
  top: 0;
  left: 29px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.right-background {
  position: absolute;
  top: 0;
  left: 32px;
  width: 12px;
  height: 100%;
  background: rgba(255, 0, 255, 0.5);
}

.inactivee a {
  display: none;
}

.inactivee .playButtone {
  display: none;
}

.activee .playButtone {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, .7);
  cursor: pointer;
  fill: #aaff00;
}

.activee {
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}

.playe,
.pausee {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 6px;
  margin: auto;
}

.pausee {
  left: 0;
}

.hide {
  display: none;
}

Or would I leave them like this?

<div class="wrape">
  <div class="covere" title="OPEN"></div>
  <ul class="nav">
    <li>

.wrap {
  position: relative;
  width: 266px;
  height: 174px;
  margin-top: 8px;
  overflow: hidden;
}

.nav a {
  float: left;
  width: 50px;
  height: 50px;
  margin: 0 4px 12px 0;
  color: transparent;
  background: rgba(0, 0, 0, .2);
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.nav a:hover {
  border: 3px solid red;
}

.nav li:nth-of-type(5n) a {
  margin-right: 0;
}

.nav li:nth-of-type(8) a {
  opacity: 0;
}

.nav li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}
.nav li:nth-of-type(15) a {
  position: relative;
  border: 3px solid #0059dd;
  background: none;
}

.left-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background: rgba(0, 255, 255, 0.5);
}

.left-border {
  position: absolute;
  top: 0;
  left: 12px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.middle-background {
  position: absolute;
  top: 0;
  left: 15px;
  width: 14px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
}

.right-border {
  position: absolute;
  top: 0;
  left: 29px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.right-background {
  position: absolute;
  top: 0;
  left: 32px;
  width: 12px;
  height: 100%;
  background: rgba(255, 0, 255, 0.5);
}

.inactivee a {
  display: none;
}

.inactivee .playButtone {
  display: none;
}

.covere {
  width: 266px;
  height: 174px;
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
  cursor: pointer;
  border: 3px solid #0059dd;
  box-sizing: border-box;
}

.covere {
  display: none;
}

.inactivee .covere {
  display: block;
}

.covere::before,
.covere::after {
  content: "";
  position: absolute;
  top: 0;
  left: 86px;
  width: 3px;
  height: 100%;
  background: #0059dd;
}

.covere::after {
  left: 177px;
}

.nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li {
  float: left;
}

.activee .playButtone {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, .7);
  cursor: pointer;
  fill: #aaff00;
}

.activee {
  background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}

.playe,
.pausee {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 6px;
  margin: auto;
}

.pausee {
  left: 0;
}

.hide {
  display: none;
}

As I’ve explained before, there are no hard and fast rules about how you arrange your CSS rules. Arrange them in a logical order which makes sense to you, and will enable you to maintain the code easily.

Just remember that later rules will override any earlier rules targeting the same element or class. That’s one reason why grouping rules together is a good policy, because it’s then easier to see which should come first. Put the more general rules before the more specific rules.

There was a discussion a few months ago about how to structure CSS. You might find it useful.

Best Practice For Css Layout

To be fair you and all the others haven’t been teaching anything just force feeding and writing code for him/her.

Given that it’s now almost 01:00 in the morning here, I’d suggest that will have to wait a few hours.

It depends what timezone you’re in.

Would it surprise you to learn that the moderation team have an idea which timezone each of us are in?