2012-06-24 100 views
0

我有这样的形象:CSS的固定图像重叠菜单

triangle

这里是网站http://maximearchambault.com

你必须要在左侧的菜单,并在合适的内容。

我想要做的是将三角形图像放在菜单旁边,使其看起来像菜单的一部分。

这里一个例子:http://www.shockblast.net/marla-singer-photography/

当你向下滚动,你会看到一个眼睛出现并在其下一切顺利。眼睛不动。

因此,我希望我的图像左对齐与右列中的内容重叠。

这里是我的默认/ style.css的

*/ 

body { 
    font-size: 13px; 
    font-family: 'Helvetica Neue', Arial, Helvetica, Verdana, sans-serif; 
    background: #fff; 
    color: #000; 
    line-height: 1.3em; 
    /* font-weight: 300; */ 
} 

/* link scheme */ 
/* you can customize links further down the page too */ 
a:link { text-decoration: none; color: #000; } 
a:active { text-decoration: none; color: #00cc00; } 
a:visited { text-decoration: none; color: #999; } 
a:hover { text-decoration: underline; } 
a img { border: none; } 

/* general styles */ 
small { font-size: 9px; } 
code { font-family: monospace; } 
blockquote { padding-left: 9px; } 

/* headings */ 
h1 { font-size: 13px; margin-bottom: 1em; font-weight: bold; } 
h2 { font-size: 13px; margin-bottom: 1em; font-weight: bold; } 
h3 { font-size: 13px; margin-bottom: 1em; } 
h4 { font-size: 13px; margin-bottom: 1em; } 

/* paragraph width */ 
#index p { margin-bottom: 1em; } 
#exhibit p, code, blockquote { width: 450px; margin-bottom: 1em; /* line-height: 1.3em; */ } 

/* highlighter style - maybe you want to change colors? */ 
.highlight { background: #ccff00; color: #000; } 

/* never adjust the margin or padding here unless you seriously know what you are doing */ 
/* think #index .container and #exhibit .container for only padding adjustments */ 
#index { width: 215px; background: #F2F2F2; /* line-height: 1.3em; */ } 
#exhibit { margin: 0 0 0 215px; } 

/* styling the index */ 
#index ul { list-style: none; margin: 0; } 
#index ul.section { margin-bottom: 1em; } 
#index ul.subsection { } 

/* the follow rules for index are not required */ 
/* they are mostly for complex customization */ 
/* for tag display */ 
#index ul#all_tags { list-style-type: none; margin-bottom: 1em; } 
#index ul#all_tags li { display: inline; margin-right: 3px; } 
#index ul#all_tags li a { } 

/* active section title */ 
#index span.active_section_title, 
#index span.active_section_title a { font-weight: bold; } 

/* active exhibit title parts */ 
li.active a:link, li a.active, li.active a:hover, li a.active, li.active a:active, li a.active, 
li.active a:visited, li a.active, li span.active, #index ul.section li.active a:link, 
#index ul.section li.active a:hover, #index ul.section li.active a:active, #index ul.section li.active a:visited 
{ font-weight: bold; } 

/* additional #index options */ 
#index ul li .password a { /* background: url(../img/locked.gif) right center no-repeat; padding-right: 18px; */ } 

/* the "new" indicator */ 
#index ul li sup { color: #0c0; font-weight: bold; text-transform: uppercase; font-size: 8px; vertical-align: top; } 
/* end styling for index */ 

/* links styles only for the #index region */ 
#index a:link { } 
#index a:hover { } 
#index a:active { } 
#index a:visted { } 

/* links styles only for the #exhibit region */ 
#exhibit a:link { } 
#exhibit a:hover { } 
#exhibit a:active { } 
#exhibit a:visted { } 

/* this is where you adjust your paddings for #index and #exhibit together */ 
.container { padding: 27px 9px 25px 27px; } 

/* this is where you pad them separately */ 
#index .container { } 
#exhibit .container { } 
+0

有人请编辑,使其可以理解。 – SVS

+0

@SVS编辑应该在同行评审时可见:) – JoeJ

回答

1

把你想要固定的元素这些属性:

.fixedElement 
    { 
     position: fixed; 
     z-index: 10; 
     top: 20px; 
     left: 20px; 
    } 

这样,它会一直固定在左上角。即使滚动后

+0

感谢代码,但我是初学者。首先,我需要代码来放置图像以及代码的位置 –

+0

此css类用于将任何元素放置在页面的左上角并留在那里...您将需要添加类似图像这个:你可以把它放在页面的任何地方 – AhHatem