[Miscommunication] How do you center non-tables?

If you know how to fix it, can you tell me so I can make the right changes? When you’re using float, I don’t understand how you keep a div in place? or maybe I’m asking the wrong question.

Once again, if you want help with your code, then please post it with the CSS separated from the HTML. We are not working with inline styles.

You’re not, I am. You’re right about that. Only on this one cause it’s stumping me and now I want to figure it out.

That’s the spirit !!! Go figure it out !

3 Likes

To be clear, I do use inline CSS sometimes, BUT only in one situation.

That is when my JavaScript is working with a DOM that is not my own.

Sometimes rather than put together CSS and append a style tag to the other pages <head> I find it easier to simply apply the CSS to the JavaScript created element.
BUT only for one or two rules. If there is more CSS than that, the appended <style> is the only easily readable and maintainable approach.

In one of your many other posts you said you wanted the design to do whatever you wanted it to.

There is such a design

<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Template</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style type="text/css">
</style>
<script type="application/javascript">
// script needed before the DOM is loaded here
</script>
</head>
<body>
<h1>Template</h1>
<script type="application/javascript">
// script that needs the DOM to be loaded here
</script>
</body>
</html>

Anything more than that and you need to consider what content the page will have.

Notice I have <style> but no <link> in the <head>

That is because as I add elements to the skeleton, I add CSS to the <style> while I’m working up the page

I do it this way because I find it easier to have one file open and take advantage of the text editors (Notepad++) highlighting feature to find things rather than to have separate files open.

BUT once the page is “finished”, the CSS is moved out into a .css file.

For me, any other approach makes it difficult to have multiple pages of a site look like they “belong”. without major headaches editing each file.

True, an article page won’t look like a sitemap page won’t look like a contact page won’t look like a custom error page etc. But for style that is common to the entire site having it all in one file makes it immensely easier to make a change. I would do it no other way. I speak from experience having moved from inline CSS to head CSS to referenced CSS over the years.

No, when you post questions for us to answer (I’m using “us” loosely, because I personally couldn’t handle these threads), and you have your code as inline styles, you are roping us in to work with inline styles.

1 Like

All I want to know is how to prevent the [div] from jumping out of the box when I click on it using the code I’m using. I’m sure there is a way since it was done here http://www.cssdesk.com/DQJFx

But I want to use this code cause it’s better.
http://www.cssdesk.com/GmM8L

It may have escaped your notice that we are not vending machines.

You said there’s a way to do it, so, I’m trying to figure it out.

No, you are not. You are trying to coerce some else into using their time to figure it out for you.

When you get a chance, it could be now, it could be next next, whenever you’re able to get to it will be fine. I don’t put a timetable on these things. I just ask questions, whenever you’re able to get to it. I would like to know if there’s an answer though that will work. There must be a way to get it to work using floats, if it works using no floats, right.

But the issue is without floats when you zoom text, then it gets all messed up. Using floats prevents it from getting messed up.

This Topic is now Closed.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.