FC2ブログ ロールオーバーについて

このQ&Aのポイント
  • FC2ブログでheaderの画像をロールオーバーする方法について調査しました。
  • FireFoxではロールオーバーができるが、IEやChromeではロールオーバーができない問題が発生しています。
  • 解決策がわからないため、ロールオーバーができる方法を知っている方に助言を求めています。
回答を見る
  • ベストアンサー

FC2ブログ ロールオーバー

私はFC2でブログをやっていてheaderの画像をロールオーバーを使いマウスが上に行ったときに違う画像が表示されるというのに挑戦し以下のものを使ってみたのですがFireFoxではちゃんとロールオーバーできたのですがIEやスレイプニルだとロールオーバーできません。何か心辺りのある方がいらっしゃいましたらご教授お願いします。 #header_body { width: 810px; /* 画像1枚分の横幅 */ height: 250px; /* 画像1枚分の高さ */ margin:10px 5px 10px; background-image: url("http://~"); /* 画像ファイル名 */ } #header_body:hover { background-position: top right; /* 背景画像の表示開始基準を右上に変更 */ }

質問者が選んだベストアンサー

  • ベストアンサー
  • Muller3
  • ベストアンサー率81% (800/979)
回答No.5

例えばHTMLで <div id="header_body"> <h1><a href="http://***">ブログタイトル</a></h1> </div> こうなっているとしたら、 #header_body a { display: block; width: 810px; /* 画像1枚分の横幅 */ height: 250px; /* 画像1枚分の高さ */ margin:10px 5px 10px; background-image: url("http://~"); /* 画像ファイル名 */ } #header_body a:hover { background-position: top right; /* 背景画像の表示開始基準を右上に変更 */ } こんな感じです。 お使いのテンプレートのHTML構造がわからないので概略だけですが…。

mega166
質問者

お礼

ありがとうございます!!解決しました!!なんとお礼を言っていいことやら^^本当にありがとうございました!!

その他の回答 (4)

  • Muller3
  • ベストアンサー率81% (800/979)
回答No.4

ビヘイビアだめなのですか。 だったら、質問者様が契約しているプロバイダに、無料ホームページスペースがあると思います。そこにhtcファイルをアップして、そっちから引くというのは?(これも未検証ですけど) というか、ヘッダーの画像だったら、a要素使うのではだめなのですか? ブログタイトルにaタグ使ってブログのURLをリンクしてるならできるんじゃないでしょうか。

mega166
質問者

お礼

やってみたんですが出来ませんでした;; a要素を使うというのはどうやれば出来るんですか?すいません、本当に素人なんで右も左もわからないんで。

  • Muller3
  • ベストアンサー率81% (800/979)
回答No.3

http://www.xs4all.nl/~peterned/csshover.html#changes から Version 2.02.060206 (1.42 and :focus) をダウンロード。 csshover2.htcというファイルになります。 これをFC2ブログの「ファイルアップロード」からアップします。 一覧に出てきたら、一番左の「表示」をクリックするとcsshover2.htcのスクリプトがポップアップで出てきますので、ブラウザのアドレス欄に表示されているURIをコピー。(「表示」の上で右クリックして「リンク先のURLを取得」してもいい) その後、テンプレートのCSSに body { behavior:url("csshover2.htcのURLをここにペースト"); } を入れる という感じだと思います。

mega166
質問者

お礼

FC2だとhtcファイルはアップロードできませんと出てしまうのですがどうすればいいですか?

noname#100277
noname#100277
回答No.2

>>スレイプニルでも同様の問題が起きるのは同じ原因ですかね? エンジンが同種で在れば同じでしょう。 但しgeckoに設定した場合は別。

mega166
質問者

お礼

なるほど、ありがとうございます。 よろしければ、IEでhoverを表示する為の具体的なやり方を教えてください。素人なんでググってみても解決できませんでした;

  • Muller3
  • ベストアンサー率81% (800/979)
回答No.1

IEではa以外でhoverが効かないので。 「hover IE」で検索かけてみると、方法がいろいろ出てきます。 http://www.google.com/search?client=safari&rls=ja-jp&q=hover+IE&ie=UTF-8&oe=UTF-8

mega166
質問者

お礼

ありがとうございます。色々いじってみようと思います。スレイプニルでも同様の問題が起きるのは同じ原因ですかね?

関連するQ&A

  • cssで、一枚の画像でロールオーバーができない。

    一枚の画像でロールオーバーさせたいのですが、 どうしてもうまくいきません; 全体 幅495px,高さ60px の画像。 幅99x30pxのボタンで、縦2,横5つ並んでいます。 縦1行目に、通常ボタンが横5つ。 縦2行目に、オンマウスボタンが横5つ。 nav1~nav5のボタンに、 通常は、1行目、1つ目のボタンが表示されていて、 オンマウスすると、画像が消えてしまいます。 わかる方、回答お願いします。 ■html <div id="globalnav"> <ul> <li id="nav1"><a href="#">a</a></li> <li id="nav2"><a href="#">b</a></li> <li id="nav3"><a href="#">c</a></li> <li id="nav4"><a href="#">d</a></li> <li id="nav5"><a href="#">e</a></li> </ul> </div> ■css #globalnav{ width:495px; height:30px; margin-left:305px; margin-top:70px; padding:0; } #globalnav ul{ list-style: none; margin:0; padding:0; } #globalnav li{ float:left; width:99px; margin:0; padding:0; text-indent:-9999px; } #globalnav li a{ display:block; text-decoration:none; width:99px; height:30px; background: url(rollover.gif) no-repeat; } /*通常*/ #nav1 a { background: 0 0; } #nav2 a { background: -99px 0; } #nav3 a { background: -198px 0; } #nav4 a { background: -297px 0; } #nav5 a { background: -396px 0; } /*オンマウス*/ #nav1 a:hover { background: 0 -30px; } #nav2 a:hover { background: -99px -30px; } #nav3 a:hover { background: -198px -30px; } #nav4 a:hover { background: -297px -30px; } #nav5 a:hover { background: -396px -30px; }

  • CSSのロールオーバーがIEで崩れます

    CSSのロールオーバーでメニューを制作しています。 背景画像のポジションを変えて、1枚の画像でロールオーバーさせるというよくあるものです。 Mac+Safari、Firefoxではきちんと表示されるのですが、 Win+IE7だと1枚の画像がそのまま表示されてしまい、ロールオーバーになりません。 (IE7しか自宅にないので他のバージョンのIEではどうなるかわかりません。) しかもline-height: 140%;という一行を削除したら1枚べろんと表示されていたところが半分程かくれました。 ロールオーバー自体でなく、他の部分がおかしいのでしょうか? ちなみに元の画像の高さは20pxで、10pxの画像を上下につなげています。 タイトル画像が120x26で、その横に絶対配置で並べています。 ど素人が手打ちで書いた文章なのでお恥ずかしいのですが、 問題の部分のCSSとhtml、全体のCSS、を以下に載せておきますのでどうぞご教授ください。 (メニュー項目の数等一部省略しているところがあります。) よろしくお願い致します。 /*CSSの記述*/ body{ margin: 0px; text-align: center; } table,tr,td,p,ul,li,h1,h2,h3,h4,h5,h6,input,textarea { line-height; 140%; color: #696969; font-family:"MS Pゴシック", Osaka, "ヒラギノ角ゴ Pro W3"; font-size: 10pt; } div#wrapper{ width: 500px; margin: 40px auto; text-align: left; } div#header{ width: 100%; position: relative; margin-bottom: 30px; } ul#menu{ position: absolute; left: 150px; top: 10px; width: 350px; height: 10px; } ul#menu li{ float: left; height: 10px; margin-right: 15px; } ul#menu li a{ margin: 0; padding: 0; height: 10px; display: block; text-indent: -9999px; outline: none; background-repeat: no-repeat; } ul#menu li a:link, ul#menu li a:visited{ background-position: left top; } ul#menu li a:hover, ul#menu li a:active{ background-position: left bottom; } ul#menu li#top a{ background-image: url(../img/top.gif); width: 32px; } ul#menu li#about a{ background-image: url(../img/about.gif); width: 48px; } ul#menu li#pict a{ background-image: url(../img/pict.gif); width: 37px; } /*HTMLの記述*/ <div id="wrapper"> <div id="header"> <h1><IMG SRC = "タイトル画像" ALT = "" border="0"></h1> <ul id="menu"> <li id="top"><a href="top.html">top</a></li> <li id="about"><a href="about.html">about</a></li> <li id="pict"><a href="pict.html">pict</a></li> </ul> </div>  ~略~ </div>

    • ベストアンサー
    • CSS
  • XTHML CSSのロールオーバーについて

    現在CSSにてロールオーバー方法についてどちらを選択する方が正しいでしょうか? 通常は一般的な一枚の画像を用意して上下に重ねあわせてhover時に下へ移動させる方法。 <画像名:gazo.jpg サイズ:200x300 ID:menu>とします。 もう1つは 予め<div id="menu"></div>で枠を設定しておき 本来のjavascript通り2枚の画像を上下に組み合わせることなく実現する方法。 #menu { height: 300px; width: 200px; float: left; } #merchandise a{ float: left; height: 300px; width: 200px; margin-top: 0px; background-image: url(images/gazo.jpg); background-repeat: no-repeat; } #merchandise a:hover{ float: left; height: 300px; width: 200px; margin-top: 0px; background-image: url(images/gazo-f2.jpg); background-repeat: no-repeat; } 前者の方はWeb上にいくつか出回っておりますが、後者の方は偶然発見しました。やはり前者の方が手間がかからなくて良いでしょうか? あなたならどっちでしょうか?

    • ベストアンサー
    • HTML
  • CSSでのロールオーバーについて

    アメーバにてブログを作ろうと思い、実験用に作ってみました。 まずは自分の作って失敗したものを見てもらいたいのです。 ttp://ameblo.jp/bakasuke-11/ ですが、ここではページ中段にある次の記事へという部分をロールオーバー用の画像にしたのですがうまくロールオーバーできません。 よくブログなどでは使われていてたぶん出来ると思うのですが たとえばこのようにしたいのです。 ↓ ttp://ameblo.jp/sunsuntaiyo/ 自分のサイトではロールオーバーの部分は .topPaging{ margin: 0px auto 10px auto;/*注1*/ width:360px;/*全体の幅注2*/ position:relative; text-align:center; } .topPaging a.firstPage{/*最初のページへ*/ background:url(http://stat.ameba.jp/user_images/a0/a8/10081778130.gif) top center no-repeat; display:block; width:18px;/*画像の横*/ height:18px;/*画像の縦*/ text-indent:-9000px; position:absolute; top:0px; left:0px;/*左からの位置注2*/ } .topPaging a.firstPage dt a:hover{ background-position:0 -18px; } .topPaging a.previousPage{/*前のページへ*/ background:url(http://stat.ameba.jp/user_images/05/f6/10081778131.gif) top center no-repeat; display:block; width:98px;/*画像の横*/ height:18px;/*画像の縦*/ text-indent:-9000px; position:absolute; top:0px; left:45px;/*左からの位置注2*/ } .topPaging a.firstPage dt a:hover{ background-position:0 -18px; } .topPaging a.nextPage{/*次のページへ*/ background:url(http://stat.ameba.jp/user_images/8e/fd/10081778132.gif) top center no-repeat; display:block; width:98px;/*画像の横*/ height:18px;/*画像の縦*/ text-indent:-9000px; position:absolute; top:0px; right:45px;/*右からの位置注2*/ } .topPaging a.firstPage dt a:hover{ background-position:0 -18px; } .topPaging a.lastPage{/*最後のページへ*/ background:url(http://stat.ameba.jp/user_images/1e/78/10081778133.gif) top center no-repeat; display:block; width:98px;/*画像の横*/ height:18px;/*画像の縦*/ text-indent:-9000px; position:absolute; top:0px; right:0px;/*右からの位置注2*/ } .topPaging a.firstPage dt a:hover{ background-position:0 -18px; } としました。 どこが間違っていてどうすれば正常に動作するのが教えてもらいたいです。 長々と見にくいですが回答お願いします。

  • CSSで画像1枚によるロールオーバー

    CSSの勉強をしているのですが、Fire Fox2.0ではうまく表示されるのに対し、IE6,7では何も表示されず困っています。どこが間違っているのか教えて頂けませんでしょうか?よろしくお願い致します。 作っている物は以下の通りです。(すべて同じ階層にあります) --------------------------------------------------------------- navi.gif(100*30のメニューが横3縦2で300*30の1枚の画像) --------------------------------------------------------------- list.html(とりあえずメニュー1つだけです) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" /> <title>リストお勉強</title> <link href="list1.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="globalnavi"> <ul> <li id="btn01"><a href="#">リスト1</a></li> </ul> </div> </body> </html> --------------------------------------------------------------- list.css /* CSS Document */ .globalnavi { width:300px; height:30px; margin:0px; padding:0px; text-align:left; } .globalnavi ul { margin:0px; padding:0px; } .globalnavi li { display:block; list-style-type:none; float:left; width:100px; height:30px; margin:0px; padding:0px; background:url(navi.gif)no-repeat; text-indent:-9999px; } .globalnavi li a { display:block; list-style-type::none; float:left; width:100px; height:30px; margin:0px; padding:0px; background:url(navi.gif)no-repeat; text-indent:-9999px; } .globalnavi li#btn01{ width:100px; background-position:0 0; } .globalnavi li#btn01 a{ width:100px; } .globalnavi li#btn01 a:hover{ width:100px; background-position: 0 -30px; }

    • ベストアンサー
    • HTML
  • Firefox2.0で背景が上段に集まってしまいます。

    以下のCSS、HTMLでdiv要素を分けて3つの細いgif画像を見た目は一つの背景になるように指定しているつもりです。真ん中のdiv要素をy方向にリピートさせて記事が長くなっても背景が崩れないページを作りたいと思っております。 IE7.0では問題なく表示してくれるのですがFirefox2.0になると背景が上段に集まってしまいます。 すみませんが改善方法をアドバイスよろしくお願い致します。 【CSS】 body { font-family: "MS Pゴシック"; margin: 0px; padding: 0px; text-align: center; background: #E8FFFF fixed; } #wrapper { text-align: left; margin: 0px auto; padding: 0px 0px 0px 20px; height: auto; width: 900px; background: url(background_3.gif) repeat-y; } #head-background { margin: 0px auto; height: 17px; width: 900px; background: url(background_7.gif) no-repeat; padding: 0px; } #header { margin: 0px; padding: 0px; height: 20px; width: 800px; } #footer {     clear: both width: 900px;     background: url(background_6.gif) no-repeat; margin: 0px auto; padding: 0px; } 【HTML】 <body> <div id="head-background"> </div> <div id="wrapper"> <div id="header"> ・・・・・(ロールオーバーリンク) </div> <div id="header"> ・・・・・(MPEG画像) </div> </div> </div> <div id="footer"> </div> </BODY> </HTML>

    • 締切済み
    • CSS
  • CSSでライブドアブログのレイアウトがIEでだけ、崩れてしまう。

    CSSでライブドアブログの左サイドバーのレイアウトがIEで見ると、崩れてしまいます。 Fireboxなどでは、きれいに表示されますが、IEでは、左サイドバーの表示がはるか下方に表示されてしまいます。 下記のCSSに問題がないか教えていただけないでしょうか? 参考になりそうなサイトとして(1)(2)なども見たのですが、結局わからなかったです。 (1)CSSによる段組(マルチカラム)レイアウト講座 ​http://www.geocities.jp/multi_column/index.html​ (2)CSSバグリスト ​http://cssbug.at.infoseek.co.jp/ よろしくお願いします。 /********************************** =2.Common **********************************/ table#header{ width:100%; font-size:12px; color: #cffdcc; } table#header a{ color: #cffdcc; } table#header th{ width:1%; } table#header th img{ margin:2px 10px; width:132px; height:24px; } table#header td.catprbox{ width:1%; white-space:nowrap; } table#header td.catprbox span{ margin-right:15px; } table#header td.newstickerbox{ width:97%; text-align:right; padding-right:10px; } table#header td.startblogbox{ width:1%; padding-right:10px; white-space:nowrap; } table#header td.startblogbox img{ width:17px; height:16px; margin-right:3px; border:0px; vertical-align:middle; } #container{ width:800px; margin:0 auto; text-align:center; } #cgmmenu{ display:none; } #banner{ height:200px; border:solid #fff; border-width:6px; background:#240000 url(http://image.blog.livedoor.jp・・・・・) no-repeat; text-align:left; margin:0 auto; clear:both; } #banner a{ color:#fff; text-decoration:none; } #banner a:hover{ text-decoration:underline; } #banner h1.blogtitle{ padding:80px 30px 5px; font-size:20px; } #banner div.description{ width:500px; padding:0 30px; line-height:135%; font-size:12px; color:#fff; } #blogcontainer{ background:url(http://image.blog.livedoor・・・・) 0 0 repeat-y; border:solid #fff; border-width:0 6px 0; padding:0 0 30px; margin:0 auto; height:1%; } #wrapper{ float:left; width:605px; } #content{ float:right; width:420px; text-align:left; background-color:#F9F3EE; } #contentin{} #left{ float:left; width:180px; } #right{ float:right; width:178px; } #lefttop , #leftbody , #leftbottom , #righttop , #rightbody , #rightbottom {} #footer { background:url(http://image.blog.livedoo・・・・) 0 0 no-repeat; border:solid #fff; border-width:0 6px 6px; height:46px; } #outfooter{}

  • 【CSS】firefoxで背景が表示されない-ナビゲーション(画像置換リンク)

    「li」に背景画像を指定して、ナビゲーションをつくってみたところ・・・ Firefox、Operaで表示されません。 (IEでは表示されます。) ヘッダー左にロゴ(これはどのブラウザでも表示される)、右側にナビゲーションを配置した作りです。 ハックなど色々調べてみたのですが、解決できず・・・。 力をお貸しいただけないでしょうか。 g_nav.gif・・・グローバルナビゲーション一枚画像550px×30px。(上部:ロールオーバー前、下部:ロールオーバー時) 【HTML】 <!--headerここから--> <div id="header"> <!--logoここから--> <div id="logo"> <h1><a href="aaa.html">logo</a></h1> </div> <!--logoここまで--> <!--naviここから--> <div id="nav"> <ul> <li id="nav01"><a href="aaa.html">あああ</a></li> <li id="nav02"><a href="aaa.html">あああ</a></li> <li id="nav03"><a href="aaa.html">あああ</a></li> <li id="nav04"><a href="aaa.html">あああ</a></li> <li id="nav05"><a href="aaa.html">あああ</a></li> </ul> </div> <!--naviここまで--> </div> <!--headerここまで--> 【CSS】 #header{ width:800px; height:70px; margin:0 auto; padding:0; } #logo { width:216px; height:70px; background-image:url(../cmn_img/logo.gif); float:left; } #nav{ width:550px; height:30px; float:right; margin:40px 0 0 0; padding:0; text-indent:-999em; } #nav ul{ margin:0; padding:0; list-style-type:none; } #nav li{ display:inline; } #nav li#nav01 a,#nav li#nav02 a,#nav li#nav03 a,#nav li#nav04 a,#nav li#nav05 a,{ display:block; background-image:url(../cmn_img/g_nav.gif); overflow:hidden; float:left; } #nav li#nav01 a{width:110px; height:30px; background-position:0 0;} #nav li#nav02 a{width:110px; height:30px;background-position:-110px 0;} #nav li#nav03 a{width:110px; height:30px;background-position:-220px 0;} #nav li#nav04 a{width:110px; height:30px;background-position:-330px 0;} #nav li#nav05 a{width:110px; height:30px;background-position:-440px 0;} #nav li#nav01 a:hover{width:110px; height:30px;background-position:0 -30px;} #nav li#nav02 a:hover{width:110px; height:30px;background-position:-110px -30px;} #nav li#nav03 a:hover{width:110px; height:30px;background-position:-220px -30px;} #nav li#nav04 a:hover{width:110px; height:30px;background-position:-330px -30px;} #nav li#nav05 a:hover{width:110px; height:30px;background-position:-440px -30px;} 【下記ハック使用】 #header:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #header {display: inline-table;} /* Hides from IE-mac \*/ * html #header {height: 1%;} #header {display: block;} /* End hide from IE-mac */

    • 締切済み
    • CSS
  • IE9で画像のロールオーバーが上手く表示されない

    CSSで一枚の画像のみを使用しロールオーバーをしてみたのですが、Google Chromeではなんとか再現できたものの、IE9で確認してみたところ、画像が全て同じ物(左上の画像)になっていました(マウスを乗せても変化なし) 初心者なので初歩的な部分でつまずいている可能性もあると思いますが、どうかよろしくお願いいたします 以下HTMLとCSSです <body> <ul id="globalnavi"> <li><a href="./info.html" target="main">info</a></li> <li><a href="./main.html" target="main">main</a></li> <li><a href="./blog.html" target="sub">blog</a></li> <li><a href="./link.html" target="main">link</a></li> <li><a href="./index.html" target="top">index</a></li> </ul> </body> #globalnavi,#globalnavi li{ display:block;list-style:none; margin: 0;padding: 0; width: 96px; } #globalnavi li{ width: 96px;height: 79px; display:inline-block; position:relative; } #globalnavi a { display: block; text-indent: -9999px; text-decoration: none; width:100%;height:100%; background: url(./img/1.png) no-repeat 0 0 ; text-decoration: none; } #globalnavi a[href="./info.html"] { background-position: 0px 0px; } #globalnavi a[href="./main.html"] { background-position: 0px -79px; } #globalnavi a[href="./blog.html"] { background-position: 0px -158px; } #globalnavi a[href="./link.html"] { background-position: 0px -237px; } #globalnavi a[href="./index.html"] { background-position: 0px -316px; } #globalnavi a[href="./info.html"]:hover, #globalnavi a[href="./info.html"]:focus { background-position: -96px -0px; } #globalnavi a[href="./main.html"]:hover, #globalnavi a[href="./main.html"]:focus { background-position: -96px -79px; } #globalnavi a[href="./blog.html"]:hover, #globalnavi a[href="./blog.html"]:focus { background-position: -96px -158px; } #globalnavi a[href="./link.html"]:hover, #globalnavi a[href="./link.html"]:focus { background-position: -96px -237px; } #globalnavi a[href="../index.html"]:hover, #globalnavi a[href="./index.html"]:focus { background-position: -96px -316px; }

    • ベストアンサー
    • CSS
  • float テキストの右下寄せ

    MTでブログを作っています。テンプレートを変更したのですが、躓いています。 width:800px; height:287px; のサイズのbackgroundの上で(中で?)右下寄せにブログタイトルと検索ボックスを表示させたいのですがうまくいきません。 かなりの初心者で独学のみでしています。どこが何なのかよく理解できていないのでheaderの部分をすべて貼ります。 /* header */ /* -------------------------------------------------------- */ h1 { width:800px; font-size:80%; font-weight:normal; color:#666666; text-align:left; margin:0 auto; padding:15px 0 0 0; } #header { width:800px; height:287px; color:#333322; text-align:left; margin:0 auto; background:#eeeedd; background-image: url(http://■■■.net/images/●●●.gif); border-top:solid 1px #bbbb99; border-left:solid 1px #bbbb99; border-right:solid 1px #bbbb99; border-bottom:0; } #header div.lbox { width:510px; float:left; } #header div.lbox p { font-size:180%; font-weight:bold; line-height:120%; margin:8px 0 5px 10px; } #header div.rbox { width:170px; padding:15px 0 0 0; float:right; } #header div.rbox input { vertical-align:top; } #header div.rbox input.box { width:120px; margin:0 5px 0 0; } #header a:link , #header a:visited { color:#333322; background:#eeeedd; } #header a:hover , #header a:active { color:#666655; background:#eeeedd; } 現在、左上にブログタイトル、右上に検索ボックス(その下に検索ボタン)があります。 これを横並びに右下へ持っていきたいのですが・・・。 それと、タイトルテキストの部分がeeeedd色の背景の上に黒字になっているのですが、eeeedd色でなくbackgroundの画像に透過させるにはどうすればよいのでしょうか??