# CSS School, buttons and things not making sense

**URL:** <https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986>\
**Category:** Dashboard\
**Created:** [17 April 2020 00:12 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986 "2020-04-17T00:12:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 00:12 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/1 "2020-04-17T00:12:32Z")

</div>

I am not wanting to post multiple topics on the same problem.

But where I am: I am confused with the stuff at [Buttons.](https://www.w3schools.com/Css/tryit.asp?filename=trycss_buttons_basic)

Yeah, it isn't this forum's concern.

I'm asking because rather than join their forum and have to introduce myself, and the people get to know me, etc etc. I'm guessing a lot of people here who are good at CSS kind of know my skill set, and it would help saving time them getting to know me.

I'm looking at that link and am wanting to apply that to NR via a `template` node.

Thing is, NR doesn't like it.

This is their screen shot.

 ![Screenshot from 2020-04-17 10-08-39](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6a13b541cdcbdb55d752e3ab6cbd1a2afc35a7b9.png)

I'm taking this as `inline CSS`.

So I open the `template` node and paste it in:

![Screenshot from 2020-04-17 10-08-23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1ca631f4b595fcd884e6e495e06e83f5a94f28c0.png)

I can't understand why it is complaining.  
I can maybe accept the first one about the HTML part.  
But the `<head>` is opened and closed.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 00:21 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/2 "2020-04-17T00:21:40Z")

</div>

just leave out the html, head etc - the dashboard already adds those.

only add the `<style> .... </style>` stuff

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 00:35 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/3 "2020-04-17T00:35:06Z")

</div>

Thanks.

So now I have gone through and added all the other lines to make it:

```auto
<style>
.button {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
</style>
<button>Default Button</button>
<a href="#" class="button">Link Button</a>
<button class="button">Button</button>
<input type="button" class="button" value="Input Button">

```

I'm not getting how there are 4 buttons.

I get that the `<style>` defines it as **internal** - sorry I said **inline** before. My bad.  
So the CSS is `internal`.

Oh.... Ok.  
So the:

```auto
<button>Default Button</button>
<a href="#" class="button">Link Button</a>
<button class="button">Button</button>
<input type="button" class="button" value="Input Button">

```

To me though that is _wrong_. Because putting a `debug` node on the node and pressing the buttons, nothing comes out.

Yeah, "You didn't specify what is to come out....".  
I'll sort of cop that, but then: They aren't buttons. A button - by my definition - is something you _press_ and a messages is sent out.  
If nothing is sent out, it isn't a button. It is just .... _decoration_.

Ok, that's _their_ problem (the school).  
Maybe I do need to join. Or is it just me being _petty_ or _pedantic_?

It seems silly to give an example of a _button_ such that it doesn't send anything when pressed.

Hey, sorry (@Steve-Mcl) and anyone else reading this.  
I'm just saying....

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 00:38 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/4 "2020-04-17T00:38:44Z")

</div>

> [@Trying\_to\_learn](#):
>
> I'm not getting how there are 4 buttons.

button = button X 2  
a class = "button" X 1  
input type="button" = button X 1

equals 4 buttons.

Actually, `<a class="button">` is a hyperlink (a == anchor) STYLED like a button (from the class="button" part)

You'll get there - its all good stuff your learning.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 00:48 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/5 "2020-04-17T00:48:42Z")

</div>

Yeah, thanks.

But do they have a `message` that is sent when they are pressed?

I keep stubbing my toes on that point.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 00:50 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/6 "2020-04-17T00:50:41Z")

</div>

> [@Trying\_to\_learn](#):
>
> But do they have a `message` that is sent when they are pressed?

No, not unless you"wire them up"

Look at the side bar help info for the ui\_template node - I think there is an example. If not, search the forum and flows (seen it many times)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 00:57 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/7 "2020-04-17T00:57:57Z")

</div>

Here's a decent thread...

> [@How can I send a message from a ui\_button inside an HTML template?](https://discourse.nodered.org/t/how-can-i-send-a-message-from-a-ui-button-inside-an-html-template/14152/7):
>
> the data-action key contain special character, i.e. - you need to put qoute char (') to make it work. It will be \<md-button class="button save" ng-click="send({topic:'clicked', payload:'button was clicked', 'data-action':'save'})"\>SAVE\</md-button\>

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 00:58 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/8 "2020-04-17T00:58:56Z")

</div>

Thanks.

(I don't know if I am getting ahead of myself, but here goes.....)

I'm wanting to make buttons so they are the same size as the supplied `button` node/s.

So I make my buttons 48 pixels (up/down) and 48 (left/right).  
Then if I put them with the other buttons, they will fit in nicely from a GUI point of view.

Is that the right size - given I haven't changed the settings from the default ones NR has.  
(Though that was kind of implied)  
Sorry. Just so all the cards are on the table.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 01:05 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/9 "2020-04-17T01:05:08Z")

</div>

Thanks.

But all that kind of falls over because weird things start to happen with the buttons when I do things like that.

As I just mentioned: I want these to be _compatible_ with the supplied `button` node for size.  
These are sorter (top to bottom) in size, and they are white.  
The other day I added `background-color=` and they became even shorter.  
I was told that is _how they are_ - and I guess I can't change that.

I am needing to find how to make their sizes all the same as a fairly high priority.

Don't worry. I am working on it, it is just slow going at this stage.

P.S.  
Oh, and there is another "kink" in that there are (bad word).... I have been shown two ways of making a button in the `template` node.  
One way has a `button down` and `button up` message. The other doesn't.  
And I am not sure they are from the same branch of structure so I can't easily interchange them. (Though why would I want to?)  
Well, so I have only one button that I (from _this time onwards_) use.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 01:06 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/10 "2020-04-17T01:06:02Z")

</div>

> [@Trying\_to\_learn](#):
>
> Is that the right size

Look in Dev tools, the exact sizes are visible in there. Use the pointer to select an element then look in the styles.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 01:08 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/11 "2020-04-17T01:08:07Z")

</div>

Alas "dev tools" (from the browser) is a whole other can of worms into which I have only just got into.

I was wanting to get the sizes from NR.

 ![Screenshot from 2020-04-17 11-07-10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/60dd060c2846e93100bff3b77ef42ac8b188fed7.png)

This is what I found/see.

So would it be 48 x 48 or (48 + 6) x (48 +6)?  
I'm going more for the former. As the latter INCLUDES the spaces between the _widgets_. Which is outside my question.

Yes?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2020 01:14 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/12 "2020-04-17T01:14:55Z")

</div>

The only source of truth is in Dev tools im afraid. You have no idea what dashboard does internally with padding, margins, sizes etc.

If you wanna do it right, you'll have to go in to Dev tools. It is the only way to know for sure.

Use the Devtools pointer to select an item then look at the values in the style window.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 02:49 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/13 "2020-04-17T02:49:05Z")

</div>

Not directly at you, but here's what I have since found:

This is the code from the `template` node.

```auto
<style>
.button {
  background-color: blue; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 0px 20px;
  cursor: pointer;
}
</style>
<button class="button">Button text</button>

```

I get a button. Nice.  
In the same "group" I put a button.  
The button is to the left. The `template` is to the right.

![Screenshot from 2020-04-17 12-47-18](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c293f153c404c174e71deebae71bcdbb41f06d6b.png)

Ok, that looks nice. Same _height_.

Let's look at what `dev tools` tells me from the browser.

Now at this point:  
The settings in the `dashboard` are the _default_ and the code for the button you can see.

Alas I can't copy from there to paste here, but look at the screen grab:

 ![Screenshot from 2020-04-17 12-50-23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d66f98dc5280c6c2de239294f85675f1054ed085.png)

24 x 24 is what I am seeing.

So the Dashboard is 48 x 48 (yeah, ok. 48/2 = )  
The code in the `template` node..... Beats me.  
Though the line:  
`padding: 15px 32px;`  
I'm guessing 15 is height? Because 32 \> 24.

I'll try making it a 1x1 button and see what I get.

But these numbers seem to be pulled from no where.

Ok, some progress...

Making it 1x1 I see this:

 ![Screenshot from 2020-04-17 12-57-14](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/744a041d6d43c8112a830859ae9c42435926c158.png)

So ok... It is 48 x 48. But where is that specified in the code?

It isn't consistent (well, what else can I call it?) with what the system is telling me.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 April 2020 07:02 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/14 "2020-04-17T07:02:16Z")

</div>

> padding: 15px 32px;

The notation is top, right, bottom, left. (clockwise)  
If you see 2 values it is top+bottom, right+left, ie symmetry,  
If you see 1 value it applies to all sides.

And this is padding, not height, ie: around the element.  
Margin is outside the element (works only if it is a block element).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/7/b74ee038896931dcdb27422bbd473cf91fbe622c.png)

In your browser you need to look at the styles panel, not the html code as that can be overwritten by style definitions.

 ![Screenshot 2020-04-17 at 09.01.16](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d30a649a744dd6cd239ebf5de5b69935ea467643.jpeg)

In case of your button, you can set it to 100% as that will be the width of the "container" it lives in, with margin:0.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 April 2020 23:14 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/15 "2020-04-17T23:14:51Z")

</div>

(Yeah, not this place's problem, but for now I have messed up my w4school's log in)

I am getting these buttons more now.

This is the code which I am using as a starting point.

```auto
<style>
/* Best so far to fit 1x1 area */
.mybutton {
  border: none;
  border-radius: 8px;
  text-align: center;
  background-color: #097479; /* Green */
  color: black; /* "Font" colour */
/* padding: 15px 10px;*/ /* This seems to change the area of blue visible 15 - height 20 - width */
  padding: 15px 0px;
  text-decoration: none;
  display: inline-block;
  font-size: 15px;
  margin: 0px 0px; /* Was 0 20 */
  cursor: pointer;
}
</style>
<button class="mybutton">xYx</button>

```

But (I know I have had replies to say how, but I am not getting them) how do I get the part that sends the payload when pressed? (and/or released)

I've got this working:

```auto
<style>
/* Best so far to fit 1x1 area */
.mybutton {
  border: none;
  border-radius: 8px;
  text-align: center;
  background-color: #097479; /* Green */
  color: black; /* "Font" colour */
/* padding: 15px 10px;*/ /* This seems to change the area of blue visible 15 - height 20 - width */
  padding: 15px 0px;
  text-decoration: none;
  display: inline-block;
  font-size: 15px;
  margin: 0px 0px; /* Was 0 20 */
  cursor: pointer;
}
</style>

<md-button class="mybutton" ng-click="send({topic:'clicked', payload:'button was clicked'})">SAVE</md-button>

```

But the text in the button is at the bottom of the button.

So progress is happening. Now I just need to work out that part.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 April 2020 08:51 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/16 "2020-04-18T08:51:41Z")

</div>

Ok, update to things done.

I've sort of got some buttons the size I want, and the look I want.

But then when I try to add them sending a payload when pressed, it all goes _pear shaped_.

 ![Screenshot from 2020-04-18 18-44-09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/110822384153826325b122b05e016d4e7fa67e21.png)

The red _volume_ button is great. But despite my efforts, I can't get an output.

`xOx` (group2) is great. It is more probable to supply two messages - (down and up).  
But again: as soon as I set the payload stuff, it goes to looking like the `xOx` button in group3.

Here are the codes:

Volume:

```auto
[{"id":"38b8cfd4.6bdd18","type":"inject","z":"b25fd092.bcc758","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":590,"y":1230,"wires":[["b7cb74fe.5a31d"]]},{"id":"b7cb74fe.5a31d","type":"change","z":"b25fd092.bcc758","name":"yellow / black","rules":[{"t":"set","p":"colour","pt":"msg","to":"yellow","tot":"str"},{"t":"set","p":"background","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1290,"wires":[["e357141b.503fb","bc9f58ce.51ceb8","42c89a7e.830f8c"]]},{"id":"46e6efd0.6c182","type":"change","z":"b25fd092.bcc758","name":"black / green","rules":[{"t":"set","p":"colour","pt":"msg","to":"black","tot":"str"},{"t":"set","p":"background","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1330,"wires":[["e357141b.503fb","bc9f58ce.51ceb8","42c89a7e.830f8c"]]},{"id":"3e2e22d5.c855e6","type":"inject","z":"b25fd092.bcc758","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":580,"y":1370,"wires":[["46e6efd0.6c182"]]},{"id":"42c89a7e.830f8c","type":"ui_template","z":"b25fd092.bcc758","group":"28891e50.95dcb2","name":"Button (Volume up)","order":1,"width":"1","height":1,"format":"<style= background:{{msg.background}}>\n<button ng-mousedown=\"send({payload: 'Down'})\" ng-mouseup=\"send({payload: 'Up'})\"> \n<i class=\"material-icons\"> <span style=\"color:{{msg.colour}}\"> volume_up </i>\n</button>\n","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":850,"y":1370,"wires":[["b42faea.561865"]]},{"id":"b42faea.561865","type":"debug","z":"b25fd092.bcc758","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1100,"y":1370,"wires":[]},{"id":"28891e50.95dcb2","type":"ui_group","z":"","name":"Group 2","tab":"273de47d.2d2bac","order":2,"disp":true,"width":"7","collapse":false},{"id":"273de47d.2d2bac","type":"ui_tab","z":"","name":"TEST","icon":"dashboard","disabled":false,"hidden":false}]

```

`oXo` (Group 2)

```auto
[{"id":"ca93012e.a3437","type":"ui_template","z":"b25fd092.bcc758","group":"28891e50.95dcb2","name":"Best so far xOx","order":8,"width":"1","height":"1","format":"<style>\n/* Best so far to fit 1x1 area */\n.button2 {\n border: none;\n border-radius: 8px;\n text-align: center;\n background-color: #097479; /* Green */\n color: black; /* \"Font\" colour */\n/* padding: 15px 10px;*/ /* This seems to change the area of blue visible 15 - height 20 - width */\n padding: 15px 0px;\n text-decoration: none;\n display: inline-block;\n font-size: 15px;\n margin: 0px 0px; /* Was 0 20 */\n cursor: pointer;\n}\n</style>\n<button class=\"button2\">xOx</button>\n\n\n\n\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":340,"y":1050,"wires":[[]]},{"id":"28891e50.95dcb2","type":"ui_group","z":"","name":"Group 2","tab":"273de47d.2d2bac","order":2,"disp":true,"width":"7","collapse":false},{"id":"273de47d.2d2bac","type":"ui_tab","z":"","name":"TEST","icon":"dashboard","disabled":false,"hidden":false}]

```

`oXo` group 3

```auto
[{"id":"de8ba5a8.3231a8","type":"ui_template","z":"b25fd092.bcc758","group":"d9a63921.b84ff","name":"Best so far xOx","order":8,"width":"1","height":"1","format":"<style>\n/* Best so far to fit 1x1 area */\n.buttonX {\n border: none;\n border-radius: 8px;\n text-align: center;\n background-color: #097479; /* Green */\n color: black; /* \"Font\" colour */\n/* padding: 15px 10px;*/ /* This seems to change the area of blue visible 15 - height 20 - width */\n padding: 15px 0px;\n text-decoration: none;\n display: inline-block;\n font-size: 15px;\n margin: 0px 0px; /* Was 0 20 */\n cursor: pointer;\n}\n</style>\n<button class=\"mybuttonX\" click=\"send({topic:'clicked', payload:'button was clicked'})\">xOx</button>\n\n\n\n\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":370,"y":1880,"wires":[["48406f5a.e6282"]]},{"id":"48406f5a.e6282","type":"debug","z":"b25fd092.bcc758","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":560,"y":1880,"wires":[]},{"id":"d9a63921.b84ff","type":"ui_group","z":"","name":"Group 3","tab":"273de47d.2d2bac","order":3,"disp":true,"width":"7","collapse":false},{"id":"273de47d.2d2bac","type":"ui_tab","z":"","name":"TEST","icon":"dashboard","disabled":false,"hidden":false}]

```

I am really missing how the button sizes are changing, and not sure the comments I have written are correct or not. But I have to start somewhere, and document what I am seeing.

The other _problem_ is that some of the buttons _work_ great at size 2x1....  
Oh, they are cropped.

Some other time.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 April 2020 11:03 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/17 "2020-04-18T11:03:17Z")

</div>

```auto
.buttonX

...

<button class="mybuttonX">

```

If you want to style all buttons the same:

```auto
button{}

```

If you want to style buttons with a `class='button'`:

```auto
.button{}

```

Now you are styling `.buttonX` but you assign a class name `class='mybuttonX'` which doesnt exist.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 April 2020 11:05 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/18 "2020-04-18T11:05:49Z")

</div>

(Redacted, but brought back to help explain my thinking)

Yeah, but _appendage_ is me trying different things to see the results and not delete what I have.

(appendage: mybutton`X` for example. mybutton works to what I want. the `X` is me trying different things.)

So if it doesn't work, I can delete that lot and go back to what was working.

So...... I am missing something in how I am doing it.  
Sorry, I know this is where the problem is, but I am not seeing the connections.

As I said in the other post I will look at it/into it. But given this is where I am at, I am not confident I am going to see it.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 April 2020 11:06 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/19 "2020-04-18T11:06:51Z")

</div>

Oh.

> [@bakman2](#):
>
> Now you are styling `.buttonX` but you assign a class name `class='mybuttonX'` which doesnt exist.

That may be part of the problem.

I'll look into it.

Thanks.

I got confused with the names.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 April 2020 11:14 UTC](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986/20 "2020-04-18T11:14:28Z")

</div>

As said above: it is cascading, define once and apply where needed. If you need 6 buttons all with the same styling, just use 1 class.

[Next page](https://discourse.nodered.org/t/css-school-buttons-and-things-not-making-sense/24986.md?page=2)
