473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

why is style = "text-align: center;" not working

Claus Mygind
571 512MB
I am trying to update my code and came across this problem. The old code as shown here does great in centering the text as shown in photo 1

I simply use "align='center'"
Expand|Select|Wrap|Line Numbers
  1. <div 
  2.     id   ="popSearch"  
  3.     align="center"
  4.     style="position:fixed; 
  5.             visibility:hidden; 
  6.             z-index:99;" 
  7.     <form  
  8.         method="POST"  
  9.         enctype="application/x-www-form-urlencoded" 
  10.     > 
  11.         <table 
  12.             name = "popSTable" 
  13.             id   = "popSTable" 
  14.         > 
  15.             <tbody id="searchData" > 
  16.             </tbody> 
  17.         </table>             
  18.     </form> 
  19. </div> 
  20.  




However when I switch the code to using style, my text no longer centers as shown in the code below and shown in photo 2.

Here is use "style = 'text-align:center;'"
Expand|Select|Wrap|Line Numbers
  1. <div 
  2.     id   ="popSearch"  
  3.     style=" text-align:center;
  4.             position:fixed; 
  5.             visibility:hidden; 
  6.             z-index:99;" 
  7.     <form  
  8.         method="POST"  
  9.         enctype="application/x-www-form-urlencoded" 
  10.     > 
  11.         <table 
  12.             name = "popSTable" 
  13.             id   = "popSTable" 
  14.         > 
  15.             <tbody id="searchData" > 
  16.             </tbody> 
  17.         </table>             
  18.     </form> 
  19. </div> 
  20.  



I have also tried applying the style code to the form, table and tbody tags and none of them work. Not sure why that is so.
Aug 22 '11 #1

✓ answered by Dormilich

you can check in Firebug, where your CSS rule is overwritten (i.e. FB shows you the style cascade)

1 3201
Dormilich
8,658 Expert Mod 8TB
you can check in Firebug, where your CSS rule is overwritten (i.e. FB shows you the style cascade)
Aug 22 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited...
1
by: wireless200 | last post by:
I'm running EM on my local box and sql server on a remote internet accessed box. How do I specify a file path for a DTS package to access files on the remote box? For example, to run a local...
3
by: Silmar | last post by:
Hi! In my form I have table which cells contain input objects of type="text" which initially are disabled. I would like to activate them by clicking on them. However because input object does...
8
by: John Brock | last post by:
I am creating an Excel workbook using VB.NET, and have run into a problem. Excel at times insists on reformatting data that I enter into cells, e.g., converting "01234" to "1234", and this screws...
7
by: Benton | last post by:
Hi there, I have a text box which will receive its value from a pop-up date picker. The user should not be able to edit this field with the keyboard or mouse. I am using ASP.NET. If I set the...
4
by: john | last post by:
Hi to All, I am new to html authoring, so sorry if my terminology is not correct or exact. I would like to position a footer div to the bottom of the browser window. As I research in the web...
1
by: vunet.us | last post by:
Mozilla reported the fix to this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=167801. When input text field is located over div, the cursor cannot be seen unless special CSS properties are...
3
by: laredotornado | last post by:
Hi, Below I have an unordered list that is displayed on the same horizontal plane (thanks for the help yesterday). What I am wondering now is I would like the contents of the DIV with class...
2
by: r_ahimsa_m | last post by:
Hello, I am learning CSS and other WWW technologies. In the folowing definition italic doesn't work: h2 { color: Brown; text-decoration: italic; }
5
by: dangt85 | last post by:
Hello, I have the following page: ... <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.