Questions tagged [alignment]

In GUI (inc. web page) context, alignment refers to the positioning of visual elements. Or for memory addresses, being a multiple of some power of 2.

In GUI (inc. web page) context, alignment refers to the positioning of visual elements. Three possibility of alignment left, right, and center.

In a memory addressing context, alignment is the placement of data or code at memory addresses that are multiples of some (usually small) power of 2, for example having an array start at a 16-byte boundary with C++ alignas(16) int foo[1024];. This means the address will end with at least 4 0 bits.

For this meaning, prefer the tag.

7934 questions
213
votes
8 answers

Purpose of memory alignment

Admittedly I don't get it. Say you have a memory with a memory word of length of 1 byte. Why can't you access a 4 byte long variable in a single memory access on an unaligned address(i.e. not divisible by 4), as it's the case with aligned addresses?
ark
  • 2,827
  • 4
  • 18
  • 18
191
votes
11 answers

Label Alignment in iOS 6 - UITextAlignment deprecated

Seems like UITextAlignmentCenter is deprecated in iOS 6. I still use it and works well, but it gives a warning. How can I fix this? label.textAlignment = UITextAlignmentCenter; Thanks.
user123
  • 2,691
  • 5
  • 19
  • 24
171
votes
5 answers

What is the Auto-Alignment Shortcut Key in Eclipse?

What is the auto-alignment shortcut key in Eclipse?
Praveen
  • 86,996
  • 72
  • 173
  • 215
165
votes
8 answers

Format output string, right alignment

I am processing a text file containing coordinates x, y, z 1 128 1298039 123388 0 2 .... every line is delimited into 3 items using words = line.split() After processing data I need to write coordinates back in another txt…
justik
  • 3,561
  • 5
  • 26
  • 47
160
votes
9 answers

Align items in a stack panel?

I was wondering if I can have 2 controls in a horizontal-oriented StackPanel so that the right item should be docked to the right side of the StackPanel. I tried the following but it didn't work:
Shimmy Weitzhandler
  • 92,920
  • 119
  • 388
  • 596
150
votes
8 answers

Align labels in form next to input

I have very basic and known scenario of form where I need to align labels next to inputs correctly. However I don't know how to do it. My goal would be that labels are aligned next to inputs to the right side. Here is picture example of desired…
Stan
  • 22,856
  • 45
  • 148
  • 231
145
votes
7 answers

Stacking Divs from Bottom to Top

When appending divs to a div with a fixed height, the child divs will appear from top to bottom, sticking at the top border. ┌─────────────────────────┐ │ Child Div 1 │ │ Child Div 2 │ │ │ │ …
Wulf
  • 3,738
  • 2
  • 19
  • 36
144
votes
5 answers

How do I vertically center UITextField Text?

I am simply instantiating a UITextField and noticing that the text doesn't center vertically. Instead, it is flush with the top of my button, which I find kind of odd since I would expect the default to center it vertically. How can I center it…
Joey
  • 7,457
  • 12
  • 50
  • 103
142
votes
4 answers

Align

I know this is a rather simple question, but I can't figure it out for the life of me. I have two links which I've applied a background image to. Here's what it currently looks like (apologies for the shadow, just a rough sketch of a…
sudo rm -rf
  • 28,958
  • 19
  • 100
  • 160
142
votes
14 answers

center aligning a fixed position div

I'm trying to get a div that has position:fixed center aligned on my page. I've always been able to do it with absolutely positioned divs using this "hack" left: 50%; width: 400px; margin-left:-200px ...where the value for margin-left is half the…
Kyle
  • 9,989
  • 17
  • 50
  • 61
141
votes
17 answers

How to vertically center

I'm trying to make a small username and password input box. I would like to ask, how do you vertically align a div? What I have is:
Username
Password
Crays
  • 2,268
  • 9
  • 26
  • 26
138
votes
9 answers

How do I center text vertically and horizontally in Flutter?

I'd like to know how to center the contents of a Text widget vertically and horizontally in Flutter. I only know how to center the widget itself using Center(child: Text("test")) but not the content itself. By default, it's aligned to the left. In…
jeroen-meijer
  • 1,568
  • 2
  • 9
  • 16
131
votes
28 answers

How to center icon and text in a android button with width set to "fill parent"

I want to have an Android Button with icon+text centered inside it. I'm using the drawableLeft attribute to set the image, this works well if the button has a width of "wrap_content" but I need to stretch to max width so I use width "fill_parent".…
jloriente
  • 1,341
  • 2
  • 9
  • 8
126
votes
17 answers

How to align input forms in HTML

I'm new to HTML and I'm trying to learn how to use forms. The biggest issue I am having so far is aligning the forms. Here is an example of my current HTML file:
First Name:
Last Name:
yoshyosh
  • 13,484
  • 13
  • 36
  • 46
118
votes
5 answers

Align button at the bottom of div using CSS

I want to align my button at the bottom right corner of my div. How can I do that? Current css of div: float: right; width: 83%; margin-right: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; height:625px; …
Harry Joy
  • 55,133
  • 29
  • 149
  • 204