Blinded by the basics [calculator project]

Blinded by the basics [calculator project]
0

#1

Ignore functionality, mostly working ‘under the hood’, but not linked together yet (or calc engine is not yet connected to seven segment text).

I’ve tried all manner of align methods and the like or ‘forcing’ ‘right’, both on child and parent. But when I do the append the digits always come out ‘centered’.

Obviously, for the simulation I’d like to have them ‘pegged’ to the right of the display and flow left-- Not sure what I am missing here.

To ‘try’, you have to hit the black button first to turn it on, then just type some numbers. #display is the container and .sevenSegment the class, though every digit also gets their own dynamic ID.

Why can’t I just get this thing to sit ‘nicely’ to the right ?!?


#2

Did you try text-align:right ?
You seem to have the same style applied in the top box as for the buttons.
You could just add:
<div id="display" class="numberFont" style="text-align:right"></div>
Inline styles take precedence over CCS on IDs which take precedence over CSS on CLASSES.


#3

Oh, wow-- (amaze!) So please do take a second and explain-- The chars are totally put together by ‘divs’ and really no ‘text’-- So why does a ‘text-align’ work here ?


#4

Not sure what you mean? If there is some text inside the div it gets aligned.


#5

I should add ‘numberfont’ is an artifact from my initial testing. I need to clear that out as it is no longer used once I went to seven seg.


#6

Maybe I am misunderstanding ‘too’… But you see my ‘append’ method… There is no ‘text’, but a lot of ‘divs’… So ‘text = divs’ ?


#7

I don’t know. CSS alignment is a pain. That’s why I am using flexbox and grid from now on.


#8

Ha. I don’t quite get either… Why also a point I wanted to stress. I’ve put a lot into this design, but also gotten ‘lost’ on something rather ‘stupid’.

No one is ‘alone’ and thank you–


#9

I follow this guy Harry Roberts @csswizardry on twitter who was recommended in a course I watched:

Here are his CSS guidelines.

I recommend the “General Rules”