Daniel984 Posted September 1, 2015 Share Posted September 1, 2015 Here is the scenario, I have developed a HTML5 webpage template for a future site I want to launch which uses three vertical container columns for text and graphics. I have a left side bar column, a center main content column and a right side bar iframe for ads and related links which I can edit separately and it updates all of the pages across the site.All of the above is defined in css in terms of left: position; top: position; width: position; height: position; and I have a footer. This simplifies my need for having a flexible template to use for my pages. Using Seamonkey Composer and other editing tools, I merely add text and graphics to the columns without having to add anymore css code. The text and graphics merely flow down the page as they are added.Now this is my problem, whenever I add a graphic to the column I can not get a css code for horizontal alignment of a graphic in the middle or center of the column. I have looked over the HTML5 code at W3Schools.com for a remedy but I can not find search terms that relate to my need. I do not want to have to write css for every graphic such as defining a right and left boarder for the graphics as a means to align each and every graphic, I just merely want to horizontally center it in the column. One remedy I have used is to adjust the width of the graphics to the column width but this adds extra time.Can anyone tell me what to do here? What am I looking for in terms of css code? Link to comment Share on other sites More sharing options...
Ingolme Posted September 1, 2015 Share Posted September 1, 2015 To align an image, wrap it in a block level element and set the text-align of that element to left, right or center. 1 Link to comment Share on other sites More sharing options...
Daniel984 Posted September 1, 2015 Author Share Posted September 1, 2015 Ok I wil try that but it seems I have tried this before, maybe I haven't ~ but well do as you recommend. Link to comment Share on other sites More sharing options...
Daniel984 Posted September 1, 2015 Author Share Posted September 1, 2015 Foxy Mod I did as you said, I added the id element to the block as <div id="center"> with #center{text-align:center;} as the css and it works fine, thank you! Link to comment Share on other sites More sharing options...
Ingolme Posted September 1, 2015 Share Posted September 1, 2015 It would be better to use class instead of id, since I expect you'll be using multiple times throughout the document. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now