Alignments in CSS

7 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.84
List Price:  €65.59
You save:  €18.74
£40.02
List Price:  £56.03
You save:  £16.01
CA$68.85
List Price:  CA$96.39
You save:  CA$27.54
A$77.12
List Price:  A$107.98
You save:  A$30.85
S$68.21
List Price:  S$95.50
You save:  S$27.29
HK$391.10
List Price:  HK$547.57
You save:  HK$156.47
CHF 46.02
List Price:  CHF 64.43
You save:  CHF 18.41
NOK kr554.84
List Price:  NOK kr776.82
You save:  NOK kr221.98
DKK kr349.42
List Price:  DKK kr489.21
You save:  DKK kr139.79
NZ$84.86
List Price:  NZ$118.81
You save:  NZ$33.95
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,520.52
List Price:  ৳7,729.18
You save:  ৳2,208.65
₹4,173.28
List Price:  ₹5,842.93
You save:  ₹1,669.64
RM238.32
List Price:  RM333.67
You save:  RM95.35
₦66,243.24
List Price:  ₦92,745.84
You save:  ₦26,502.60
₨13,999.18
List Price:  ₨19,599.98
You save:  ₨5,600.79
฿1,857.12
List Price:  ฿2,600.12
You save:  ฿743
₺1,622.27
List Price:  ₺2,271.31
You save:  ₺649.04
B$259.73
List Price:  B$363.64
You save:  B$103.91
R934.43
List Price:  R1,308.28
You save:  R373.84
Лв91.63
List Price:  Лв128.30
You save:  Лв36.66
₩69,279.33
List Price:  ₩96,996.60
You save:  ₩27,717.27
₪186.71
List Price:  ₪261.41
You save:  ₪74.69
₱2,889.54
List Price:  ₱4,045.59
You save:  ₱1,156.04
¥7,894.37
List Price:  ¥11,052.75
You save:  ¥3,158.38
MX$855.53
List Price:  MX$1,197.81
You save:  MX$342.28
QR183.78
List Price:  QR257.31
You save:  QR73.52
P714.32
List Price:  P1,000.11
You save:  P285.78
KSh6,668.17
List Price:  KSh9,335.98
You save:  KSh2,667.80
E£2,392.69
List Price:  E£3,349.95
You save:  E£957.26
ብር2,866.71
List Price:  ብር4,013.63
You save:  ብር1,146.91
Kz41,718.65
List Price:  Kz58,409.45
You save:  Kz16,690.80
CLP$48,067.30
List Price:  CLP$67,298.07
You save:  CLP$19,230.76
CN¥361.97
List Price:  CN¥506.79
You save:  CN¥144.82
RD$2,943.98
List Price:  RD$4,121.81
You save:  RD$1,177.82
DA6,730.95
List Price:  DA9,423.87
You save:  DA2,692.92
FJ$114.25
List Price:  FJ$159.96
You save:  FJ$45.71
Q390.96
List Price:  Q547.38
You save:  Q156.41
GY$10,529.51
List Price:  GY$14,742.16
You save:  GY$4,212.64
ISK kr7,023.09
List Price:  ISK kr9,832.89
You save:  ISK kr2,809.80
DH508.71
List Price:  DH712.24
You save:  DH203.52
L887.81
List Price:  L1,243.01
You save:  L355.19
ден2,890.32
List Price:  ден4,046.68
You save:  ден1,156.36
MOP$402.89
List Price:  MOP$564.08
You save:  MOP$161.19
N$939.91
List Price:  N$1,315.96
You save:  N$376.04
C$1,851.58
List Price:  C$2,592.36
You save:  C$740.78
रु6,678.15
List Price:  रु9,349.94
You save:  रु2,671.79
S/188.35
List Price:  S/263.70
You save:  S/75.35
K194.24
List Price:  K271.96
You save:  K77.71
SAR187.48
List Price:  SAR262.49
You save:  SAR75
ZK1,347.15
List Price:  ZK1,886.12
You save:  ZK538.96
L233.12
List Price:  L326.39
You save:  L93.26
Kč1,178.64
List Price:  Kč1,650.20
You save:  Kč471.55
Ft18,305.53
List Price:  Ft25,629.21
You save:  Ft7,323.68
SEK kr550.47
List Price:  SEK kr770.71
You save:  SEK kr220.23
ARS$44,067.56
List Price:  ARS$61,698.11
You save:  ARS$17,630.55
Bs347.73
List Price:  Bs486.86
You save:  Bs139.12
COP$193,896.94
List Price:  COP$271,471.23
You save:  COP$77,574.29
₡25,583.92
List Price:  ₡35,819.54
You save:  ₡10,235.61
L1,243.01
List Price:  L1,740.31
You save:  L497.30
₲375,896.46
List Price:  ₲526,285.13
You save:  ₲150,388.66
$U1,928.40
List Price:  $U2,699.91
You save:  $U771.51
zł203.42
List Price:  zł284.80
You save:  zł81.38
Already have an account? Log In

Transcript

Today we are going to discuss about the Align How can you align your content or elements using CSS you know very well about the text align center text align your center for suppose if you want to align your image to center page, or you can also align your things using the positioning using the position property. And you can also use many techniques available in the CSS for suppose now I am saying that I have something I have come in the quarter, you can easily get to the core. Now I'm saying if you want to align a div, so how can you do that? I'm saying this is the div. I'm saying class. And my div one, make sure I have some content inside there.

I'm saying my panda here. And now you can call this dip in your seat is fine. Call this tip here. Now I'm seeing that the properties are using margin, auto. And I'm seeing the second properties border to pixel solid red. Okay?

Then go to the page refresh the page. So now as you can see, it's showing you at the left align. So I'm saying the worth is written for suppose 50 person. Go to the page, refresh the page. Now as you can see, you are setting a particular Dave at center. So this is a technique one and how can you align your paragraphs you don't really well if you have a paragraph single paragraph you want to set this the center I'm seeing this is my simple para.

So now I have to say that class, okay? Now I'm saying I'm going to give this class I'm saying my simple you can also use anything you want. So now I'm saying this is my data. Dog class and this is my data. I'm saying text align, and the value is center. So this is a property and this is a center.

This is a property and this is a way Okay, now go to the page, refresh the page and as you can see, showing you at the center so it's totally depend upon you. And if you have an image for suppose you have an image, I'm saying that I have image. Let me show you an image. I'm saying I have image in the source file. In the assets, I have logo dot png image inside. Now I'm seeing I have the class my image.

Now I'm seeing that here, I have to define the image. Make sure this is the image. Okay, now I'm saying the image is this, I'm saying display, block, display block property and I'm saying margin left off art of miniature art oh and also I am saying margin right ardal the page refresh the page. So now as you can see, I'm showing you at the center I'm saying with also is 50. Does a page refresh the page now as you can see, you are showing your logo or your image at the center, you can also define your div by using the positioning for suppose if you have a day and now i'm saying is your day and you have a class, my dear to my disco. And you have a paragraph I'm sorry that they now call this my div to styling.

Here I'm saying position absolute. This is the absolute. I'm saying from the, this is the border, one pixel solid red. And now I'm saying that the right side is 00 pixel. Refresh the page. So now as you can see, you are showing your div at the right side by default Left side, okay, so in this way you can also define your element.

So now I'm saying for suppose I have another div for copy this bad boy is this bad boy here and change just for class. Okay, third class. Now one thing, I want to set this by using a float, make sure you can change the alignment using the floor. property. Now I'm saying that float equals two, right make sure it's a property and this is the value. And now I'm seeing the word is the word is 200.

And I have a border, one pixel solid red. Make sure you can Okay, page. Now as you can see you are showing at the right side, make sure because you're using the absolute class for this element. So that's why it's showing you like this. I'm going to add comment for this, refresh the page. Now as you can see, it's showing you and like this kit, now I'm going to use my data brought cash flow.

Now, in this way you can align your content we have a lot of techniques or we have a lot of properties by using. By using that properties. You can align your content or align your divs align your paragraphs, centers left, right so it's totally depend upon you. So go to the internet and Just as there's something or play with them so thank you for watching

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.