質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

CSS

CSSはXMLやHTMLで表現した色・レイアウト・フォントなどの要素を指示する仕様の1つです。

Q&A

解決済

1回答

1147閲覧

要素が被ってしまい、隠れてしまっている状態にいます。

avicii

総合スコア49

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

HTML

HTMLとは、ウェブ上の文書を記述・作成するためのマークアップ言語のことです。文章の中に記述することで、文書の論理構造などを設定することができます。ハイパーリンクを設定できるハイパーテキストであり、画像・リスト・表などのデータファイルをリンクする情報に結びつけて情報を整理します。現在あるネットワーク上のほとんどのウェブページはHTMLで作成されています。

CSS

CSSはXMLやHTMLで表現した色・レイアウト・フォントなどの要素を指示する仕様の1つです。

0グッド

0クリップ

投稿2019/05/22 11:43

編集2019/05/22 12:11

今現在、ボタンにカーソルを置くと、メニューが表示されるようにしています。しかし、そのメニューが真下にいかないで、要素が被ってしまい、ずれてしまっている状態になっています。もしわかるかたがいらしたら、教えていただきたいです。

イメージ説明

app/assets/stylesheets/style.scss

.photo { padding: 0; } .head-container { background-color: white; } .headed { list-style: none; display: flex; height: 75px; } .headed li { width: 150px; text-align: right; height: 50px; line-height: 50px; font-size: 22px; margin-top: 0.8%; margin-bottom: 1%; color: $accent; } li.left { width: 400px; font-size: 34px; margin-left: 3.5%; margin-right: 5%; color: $accent; font-weight: bold; } li.first { width: 630px; } /* Chance to Chance */ a.home { color: $accent; } /* logout */ a.logout { display: inline-block; color: $accent; margin-top: 3.0px; margin-right: 10.0px; padding-right: 5.0px; text-decoration: none; border-radius: 3px; transition: .4s; } /* */ /* guider */ .guider_nav { height: 100px; width: 400px; margin-left: 500px; position: relative; right: 0; span { top: 5px; display: block; float: left; margin-left: 0px; margin-top: 11px; width: 100px; height: 50px; font-size: 25px; cursor: pointer; position: absolute; color: $accent; left: 48px; &:after { content: '▼'; font-size: .7em; margin-left: -4px; } &:hover ul { color: $accent; display: block; } } ul { display: none; position: absolute; top: 46px; right: 0; border-left: 1px solid #d8d8d8; border-right: 1px solid #d8d8d8; box-shadow: 1px 2px 5px rgba(0,0,0,0.1); li { background-color: #f0f0f0; a { display: block; padding: 10px 20px; text-align: left; border-bottom: 1px solid #d8d8d8; } } } } li.category { font-size: 19px; width: 150px; background-color: white; height: 214px; text-align: center; left: 5px; } a.guider-category { color: $accent; } a.plan { font-size: 25px; color: $accent; display: inline-block; padding: 0.1em 0.8em 0.1em 1em; text-decoration: none; border: solid 2px white; border-radius: 3px; transition: .4s; float: right; margin-right: 100px; margin-top: 15px; } a.plan:hover { background: #67c5ff; color: white; }

app/assets/style.scss

div.contents.row { h2 { @include boxBase(20px 0, 0); font-weight: normal; strong { font-weight: bold; padding-right: 5px; font-size: 1.2em; } } div.avicii { top: 12%; bottom: 0; right: 0; font-size: 15px; padding: 0 auto; } div.martin.garrix { top: 12%; bottom: 0; right: 0; font-size: 15px; padding: 0 auto; .clear { clear: left; } } .new_user{ font-family: "游ゴシック", "YuGothic"; } div.content_post, .edm_post { @include boxBase(20px 0 ,30px); position: relative; height: 400px; color: #fff; background-size: cover; background-position: center center; border-radius: 3px; box-shadow: 0 0 10px rgba($black,0.2); &:after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; @include filter-gradient(#000000, #a60000, vertical); @include background-image(linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 62%,rgba(0,0,0,0.85) 100%)); z-index: 1; border-radius: 3px; } .more { position: absolute; cursor: pointer; top: 20px; right: 30px; z-index: 2; height: 100px; width: 80px; text-align: right; &:hover ul.more_list { display: block; } ul.more_list { position: absolute; text-align: left; width: 80px; right: 0; font-size: 12px; background-color: #fff; border: 1px solid #ddd; display: none; box-shadow: 1px 1px 2px rgba(0,0,0,0.2); border-radius: 3px; li { border-bottom: 1px solid #ddd; &:last-child { border-bottom: 0; } a { display: block; padding: 5px; &:hover { background-color: $accent; color: #fff; } } } } }

app/views/layout/application.html.erb

<body class="photo"> <header> <div> <div class="head-container"> <nav class="headed"> <li class="left"><a class="home" href="/plans">Chance to Chance</a></li> <% if guider_signed_in? %> <div class="guider_nav"> <span><%= current_guider.nickname %> <ul> <li class="category"> <a class="guider-category", href="/guiders/<%= current_guider.id %>">マイページ</a> <a class="guider-category", href="/guiders/<%= current_guider.id %>/go">プロブレム</a> <%= link_to "ログアウト", destroy_guider_session_path, method: :delete, class: 'guider-category' %> </li> </ul> </span> <a class="plan" href="/plans/new">プラン</a> </div> <% end %> <% if tourist_signed_in? %> <li class="first"> <%= link_to "Logout", destroy_tourist_session_path, method: :delete, class: 'logout' %> </li> <li class="second"> <a class='post' href="/tourists/show">Contact</a> </li> <% end %> <% if ! (guider_signed_in? or tourist_signed_in?) %> <li class="first"><%= link_to "traveller", new_tourist_session_path, class: 'post' %></li> <li class="second"><%= link_to "guider", new_guider_session_path, class: 'post' %> </li> <% end %> </nav> <hr class="bar"> </div> </div> </header>

app/view/plans/index.html.erb

<div class="contents row"> <% @plans.each do |plan| %> <div class="content_post" style="background-image: url(<%= plan.image %>);"> <div class="more"> <span><%= image_tag 'arrow_top.png' %></span> <ul class="more_list"> <li> <%= link_to 'detail', "/plans/#{plan.id}", method: :get %> </li> <% if guider_signed_in? && current_guider.id == plan.guider_id %> <li> <%= link_to '編集', "/plans/#{plan.id}/edit", method: :get %> </li> <li> <%= link_to '削除', "/plans/#{plan.id}", method: :delete %> </li> <% end %> </ul> </div> <%= simple_format(plan.title) %> <span class="name"> <a href="/guiders/<%= plan.guider_id %>"> <span>guider</span><%= plan.guider.nickname %> </a> </span> </div> <% end %> </div>

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

mepon

2019/05/22 12:09

フレームワークを使われているのであればタグに追加しましょう
avicii

2019/05/22 12:12

ありがとうございます。追加します。
guest

回答1

0

ベストアンサー

.guider_navの要素にz-index: 2;を追加する。

投稿2019/05/22 14:21

yasutomi

総合スコア2937

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

avicii

2019/05/23 11:42

ありがとうございます。解決することができました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問