Jump to content

[SOLVED] css tables


M.O.S. Studios

Recommended Posts

Hey guys,

I'm trying to make a menu that consists of 3 parts,

1 left side 20wx40h image

2.contents *800wx40 black square with the option inside

3.right side 20wx40h image

 

* 800 minimum but will expand if content expands..

 

and the whole thing to be centered,

i know how to do this in tables but I'm trying to embrase the future off css and it killing my brain

 

any ideas thanks in advance

 

the css

.menu_ph{
display:inline-table;
width:800px;
height:40px;
background: transparent;
text-align: center;
}

.menusides{
display:table-cell;
width:20px;
height:40px;
}

.menucontent{
display:table-cell;
width:800px;
height:40px;
background:#000;
text-align: center;
font-family: Comic Sans MS, san sarif, Arial;
font-size:30px;
font-weight:heavy;
font-color:#ffffff;
}

.menucontent a{
text-decoration: underline;
}

 

the html

<div class='menu_ph'>
<div class='menusides'><img  src='images/menu/left.png'></div>
<div class="menucontent"><?php echo MENUS; ?></div>
<div class='menusides'><img  src='images/menu/right.png'></div>
</div>

Link to comment
Share on other sites

the css

.menu_ph { display:block; width:100%; border:0px;}

.menu_rows { display:block; height:100%; white-space:nowrap; clear:left;}

.menu_leftcell{
display:block;
float:left;
height:40px;
width: 34%;
white-space: normal;
}

.menu_cell {
display:block;
float:left;
height:40px;
width: 32%;
white-space: normal;
}

.menu_cell #cellinfo
{
height:40px;
line-height:40px;
background:#000;
text-align: center;
font-family: Comic Sans MS, san sarif, Arial;
font-size:30px;
font-weight:heavy;
font-color:#ffffff;
}

 

 

<div class="menu_ph">
  <div class="menu_rows">
    <div class="menu_leftcell" style="text-align:right; "><img src='images/menu/left.png'></div>
    <div class="menu_cell" style="text-align:center; "><div id='cellinfo'><?php echo MENUS; ?></div></div>
    <div class="menu_cell" style="text-align:left; "><img src='images/menu/right.png'></div>
  </div>
</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.