css - Centering a variable based title that is positioned absolutely -


alright have page that's title changes based on person logged in (their name title of page). because of fact name going different means needs positioned via center of text expand out horizontally both ways. i'm uncertain how approach , have tried few things due variable length of title none of suggestions have panned out. give basics of i'm @ code wise:

#profteamname{ position:absolute; text-align:center; top:220px; left: 550px; color: white; text-shadow: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em darkblue; text-decoration:underline; 

i wouldn't against using relative positioning. long expand horizontally.

(prefer use absolute positioning long story there take can get)

thank guys time.

rather positioning div left side of page, stretch across entire window (or container div on page) using width:100%;. it'll take entire width , align text - regardless of length - in middle of div.

css

.header {   position:absolute;   text-align:center;   top:50px;   width:100%;  /* take width of window or container div */   /* rest of code */ } 

here's codepen mockup can play with.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -