Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Aligning text using Span class
(1 viewing) (1) Guest
All your queries regarding CSS will be solved in this forum
  • Page:
  • 1
TOPIC:

Aligning text using Span class

Aligning text using Span class 1 year, 6 months ago #306

  • kuldeep
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
I have the following statement in my css sheet:

span.c4{font-family: Arial, Calibri, Sans Serif; font-weight:bold; text-align:center;}


In my html I have the following statement:

<span class="c4">Travel Agency</span>

this lies within a <p></p> that is using "justified" text.

Why will my text "Travel Agency" not appear in the center horizontally?

Thanks
The following user(s) said Thank You: davidlarge

Re: Aligning text using Span class 1 year, 5 months ago #356

  • manav
  • OFFLINE
  • Senior Boarder
  • Posts: 51
  • Karma: 0
That is because SPAN is an inline element it can't use text-align. You might give it
"display: block" to change this.
  • Page:
  • 1
Time to create page: 2.53 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download